Page 1 of 1

Text box to appear after combo box selection?

Posted: Thu Jan 11, 2007 11:24 pm
by cturner
I want to know how I can make a text box appear after someone has made a certain selection from a combo box using JavaScript?

--- Option 1 ---
--- Option 2 ---
--- Option 3 ---
--- Other --- (on select make text box appear)

Thanks in advance.

Posted: Thu Jan 11, 2007 11:46 pm
by feyd
You will need to use the onchange attribute of the <select> tag. The code will need to check the value of the select to determine if it is indeed "other" and then alter the display or visibility properties controlling the input.

Posted: Fri Jan 12, 2007 12:49 am
by neel_basu
Use The Textbox in a separate div
After the onhange event on the select the appropiate textbox would be
appenden in the div

You Can Use document.getElementById("divname")
and
appendChild()