Page 1 of 1
onchange event for select
Posted: Wed May 09, 2007 12:33 am
by pleigh
hi, i just wanted to know how to come up with this one..i have a <select> and if i select an option from that item, i want another <select> to appear right beside it. i don't know how to do this because im fairly new to javascript. thanks.

Posted: Wed May 09, 2007 5:50 am
by CoderGoblin
If you have select options already in the second select not affected by the first simply build it and set it's style to display:none; or whatever. The onchange event of the first select should simply change this style setting.
If the response of the first select affects the content of the second select you need to "chain select". Many solutions out on the web and this forum.
Dynamic/Chained Selects using Ajax Prototype/JQuery may give you some ideas.