Sapphiro
Apr 23rd 2009, 10:07 am
Hi there people, I'm developing a new social website and I'd like to find out how I can use javascript to show different hidden <div> based on the selected value from a particular drop down box. I only need to know the basic structure so I can work out from there. :)
Here's the example scenario:
A user wants to register at my site, so when he selects his country from the drop down menu, a few 'originally-hidden' City & state input fields appear based on his selection. It's something like hotmail registration concept but I just need a simple code structure so I can continue with this concept. :)
eg.
<select id="country">
<option>Country A</option>
<option>Country B</option>
</select>
if.. selected value is country A, show the dropdown menu for a list of Country A's cities and states.
and if.. selected value is country B, show the dropdown menu for a list of Country B's cities and state.
so far, my only lead is to use
<select id="country" onblur="...javascript">. =/
Help is gladly appreicated. :)
Here's the example scenario:
A user wants to register at my site, so when he selects his country from the drop down menu, a few 'originally-hidden' City & state input fields appear based on his selection. It's something like hotmail registration concept but I just need a simple code structure so I can continue with this concept. :)
eg.
<select id="country">
<option>Country A</option>
<option>Country B</option>
</select>
if.. selected value is country A, show the dropdown menu for a list of Country A's cities and states.
and if.. selected value is country B, show the dropdown menu for a list of Country B's cities and state.
so far, my only lead is to use
<select id="country" onblur="...javascript">. =/
Help is gladly appreicated. :)