Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
|
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 29th, 2004, 12:39 PM
Registered User
 
Join Date: Aug 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default enter text in dropdownlist

Hi!
I have a drop down list which I am populating from a database.
What I need to do is that when the focus is on the drop down list,
the user should be able to enter text.
Can anyone pleeease tell me how to do this?
Thanx.

 
Old September 30th, 2004, 12:08 AM
Authorized User
 
Join Date: Jul 2004
Posts: 68
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to aravwind Send a message via Yahoo to aravwind
Default

u shall hav a listitem as "new" in ur list
on click, open a popup window with a textbox,
ok, cancel buttons.
save the item in the database and display
 
Old September 30th, 2004, 01:40 AM
Friend of Wrox
 
Join Date: Jul 2004
Posts: 345
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to gokul_blr Send a message via Yahoo to gokul_blr
Default

This is similar one explained as above
<script type="text/javascript">
function displaytxtbox(x)
{
var displaytxtbox="txtbox"+x;
var displaytxtbox=document.all(displaytxtbox);
displaytxtbox.style.display="";
}
function removelist(x)
{
var removelist="list"+x;
var useremovelist = removelist;
var removelist=document.all(removelist);
removelist.style.display="none";
}
function zipcode(a)
{
if (a == "new") {
removelist(1);
displaytxtbox(1);
document.OrganizationForm.zip_code.value='';
}
}
</script>

<form name="OrganizationForm">
<input type="text" name="zip_code" size="4" id="txtbox1" style="display: none;">

<select name="choose_zip_code" id="list1" onChange="zipcode(this.form.choose_zip_code.value) ;return true;">

<option value="60601">60601</option>
<option value="77777">77777</option>
<option value="new">new</option>

</select>
</form>


If a user selects an existing zip code from the drop-down list, the selection just gets highlighted as normal. If they're zip code isn't listed and they click "new", the drop-down list disappears and a blank input box appears in it's place.


Gokulan Ethiraj





Similar Threads
Thread Thread Starter Forum Replies Last Post
Using Enter to jump to the next text field dimeanel Visual Basic 2005 Basics 2 April 29th, 2007 01:25 AM
enter key within text area shs BOOK: Beginning ASP.NET 1.0 0 April 12th, 2004 11:08 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.