473,396 Members | 1,722 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

possible to allow a user to type directly into a dropdown list to add new item?

i've got a dropdown list with various options added to it. i want to add a
button that allows the user to "Add New Option' which should create a blank
row on the dropdown list and allow the user to type directly into it.

is this possible?
Nov 19 '05 #1
4 8073
Have a textbox (or 2 if you want a seperate value/text) and then you should
be able to .Add() and item to the List that you are binding to the control.
Alot depends on how you are binding it though.

You can also do it clientside with javascript if you can grab the ID of the
the control.

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

"Dica" wrote:
i've got a dropdown list with various options added to it. i want to add a
button that allows the user to "Add New Option' which should create a blank
row on the dropdown list and allow the user to type directly into it.

is this possible?

Nov 19 '05 #2
not with the dropdown. you can build buy a new one (basically a text box
with javascript to create the drown menu with dhtm), or popup a textbox that
is filled in then update the dropdown. if done clientside, you will need to
pass the info to the server in a hiddenfield.

-- bruce (sqlwork.com)

"Dica" <ge*****@hotmail.com> wrote in message
news:vo********************@rogers.com...
i've got a dropdown list with various options added to it. i want to add a
button that allows the user to "Add New Option' which should create a
blank
row on the dropdown list and allow the user to type directly into it.

is this possible?

Nov 19 '05 #3
Dica,

I think the way to do this would be with css and javascript. You could click
your new item button and have it float a textbox directly over the dropdown.
Then after the user types into the textbox use a postback on enter key press
to post back and truly add the item to the drop down list, database, and
whatever else you need to do with it.

For finding the correct spot to float the javascript I have a
ScrollToElement and post back on enter key press methods in a Javascript
component that I give away free you could use to find where to float the
textbox and to do the postback with. You may find them at:
http://www.aboutfortunate.com?page=javascriptdemo
--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Dica" <ge*****@hotmail.com> wrote in message
news:vo********************@rogers.com...
i've got a dropdown list with various options added to it. i want to add a
button that allows the user to "Add New Option' which should create a
blank
row on the dropdown list and allow the user to type directly into it.

is this possible?

Nov 19 '05 #4

"S. Justin Gengo" <justin@[no_spam_please]aboutfortunate.com> wrote in
message news:ep**************@TK2MSFTNGP12.phx.gbl...
Dica,

I think the way to do this would be with css and javascript. You could click your new item button and have it float a textbox directly over the dropdown. Then after the user types into the textbox use a postback on enter key press to post back and truly add the item to the drop down list, database, and
whatever else you need to do with it.

For finding the correct spot to float the javascript I have a
ScrollToElement and post back on enter key press methods in a Javascript
component that I give away free you could use to find where to float the
textbox and to do the postback with. You may find them at:
http://www.aboutfortunate.com?page=javascriptdemo
interesting solution. tks for the suggestion.


--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Dica" <ge*****@hotmail.com> wrote in message
news:vo********************@rogers.com...
i've got a dropdown list with various options added to it. i want to add a button that allows the user to "Add New Option' which should create a
blank
row on the dropdown list and allow the user to type directly into it.

is this possible?


Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Da Costa Gomez | last post by:
Hi all, I was wondering whether it is possible to create (probably with the help of css) a dropdown list with the following structure. < > The stuff between the <..> are the visible items....
1
by: Jason Huang | last post by:
Hi, I want to create a Web form in asp.net, using C#. So in a web page, we have one DropDown List or one DataGrid, that when we click an item from a dropdown list, there will pop up another web...
1
by: Brian Reaburn | last post by:
Hi, I'm looking for some help. I would like to know how to launch a new IE browser window when I select an item from a dropdown list. I know this is possible I've seen many examples of where...
4
by: Andy Sutorius | last post by:
Hi, I created a web user control, a dropdown list of countries which binds to a select statement. I have placed that control in 2 different locations within the same form, but in different...
0
by: Sebastian Santacroce | last post by:
Hello, I insert a class into my dropdown list so that it I can store an ID with a name and only show the name. I can select list items with the dowpdownlist method FindString(Name), however is...
3
by: Cagey | last post by:
What I'm trying for: If this selection or if click on selection (highlighted line choice/ which ever selection change) w/in query's combo dropdown list box (on Switchboard), then Open in...
4
by: thomas.pohl | last post by:
Hi, let's assume you want to nicely print the content of a list except for one (or some) individual item. You could do it like this: t = print("text: %s\nvalues: %i %i %i" % (t, t, t, t)) ...
9
by: hooijdonk | last post by:
Hi, using a form I have been trying to get a list box to display the values of database table and have two options on there. a) the user can select a list item and click a button to delete that...
4
by: pavanip | last post by:
Hi, I am having 2 dropdown lists 1st dropdownlist contains A-Z list.2nd dropdown list contains some names like akila,bindu,chinni,....zibra etc. when i select name in 2nd dropdown list, the...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.