Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to make dropdown control can be edit

Status
Not open for further replies.

vicky2003

Programmer
May 27, 2003
22
CA
Hi, does anyone know how to make dropdown control be edited.
user can select a option, can edit at the same time?
 
This question looks a little neglected. The short answer is - you can't. However - never let the limitations of one control dictate what you do with your site.

You can have both a plain text input field and the drop-down box positioned such that it is fairly obvious to the user that if they wish to enter a different value, they put it in the textbox (perhaps have an 'Other...' option in the drop-down which would then set the text box to enabled/visible)

You can then use javascript to set the value of a hidden field based on the contents of the two controls. Ie if the value of the dropdown is 'Other...' use whatever is in the text-box, otherwise use what is selected in the drop-down.

Hope this gives you something to work with.
 
In c++ and VB it's called a combo box. Unfortunately you don't get them in HTML.

What you could do is have a textbox with an image of the dropdown arrow next to it (or a button with ' v ' on it).
Then when the button is clicked show a menu on a layer. when a value on the layer is clicked use a function to put the value into the textbox.

I was going to make one a while ago but decided it wasn't worth it.

A common programming error:
if (!IknowHow) {answer="can't be done"}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top