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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Editable Combo box?

Status
Not open for further replies.

Broccoli2

MIS
Mar 26, 2001
161
GB
In an HTML <FORM> I'm using a <SELECT></SELECT> to display a combo box. However, I'd like to be able to let the user input a value that's not in the list (much like a Microsoft editable combo box). I've had limited success with two overlapping layers (one with the select, the other with a standard <INPUT TYPE=&quot;text&quot;>) and a toggle button, but not only does this look a mess, but has opened a can of worms regarding cross-browser compatability. Please please please does anyone have a simpler solution?

-Rob
 
its really simple, actually:

var newOption=new Option;
newOption.value='6';
newOption.text='Six';
//then add it to the select box
document.formOne.selectBox.options[document.formOne.selectBox.options.length]=newOption;

now, with a quick look I'd say thats what js-examples.com does, but here is the code for you right there theEclipse
eclipse_web@hotmail.com
**\\||It was recently discovered that research causes cancer in rats||//**
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top