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

D

Dica

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?
 
G

Guest

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.
 
B

Bruce Barker

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)
 
S

S. Justin Gengo

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
 
D

Dica

S. Justin Gengo said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,996
Messages
2,570,238
Members
46,826
Latest member
robinsontor

Latest Threads

Top