dependent select menu
Hello all
I have 3 dependent menus(that 2 of them are working)but for the third one I conditions are different:
1-when we select an item in first select, in the second select will show the values that are related to first select
2-when we select an item in second select,if we select some special values in the third select will show the values that are related to second select:
for example:we select meadle east in first select
then it will show the countries of meadle east and when we select iran in second swelect(jus when we select iran) it will show some cities of iran in the third select
the code for third select is as below:
<select name="country">
<option value="iran">Iran</option>
....
</select>
<select name="city">
<option value="tehran>Tehran</option>
...
</select>
<script for="country" language="VBScript" event="onchange">
if document.forms[form1].country.options[country.selectedIndex]='Iran' then
document.form1.city.options[1]=new option('tehran','tehran')
... end if
</script>
can we write the code like this?whould some one help me please.thank you
|