onchange event for select

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
pleigh
Forum Contributor
Posts: 445
Joined: Wed Jan 19, 2005 4:26 am

onchange event for select

Post 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. :)
User avatar
CoderGoblin
DevNet Resident
Posts: 1425
Joined: Tue Mar 16, 2004 10:03 am
Location: Aachen, Germany

Post 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.
Post Reply