Click to See Complete Forum and Search --> : How to find the index of value in the drop down list box


tatayya
11-17-2003, 08:16 AM
I want to find the index of value in the drop down list box

ex:

if i have two select boxs like

<select name="name">
<option value="ravi#34">34</option>
<option value="raju#32">32</option>
<option value="srini#30">30</option>
</select>


<select name="age">
<option value="34">34</option>
<option value="32">32</option>
<option value="30">30</option>
</select>

when i select some name from name drop down list box i am getting the age by splitting name value . after that i want to find the index of 32 and then i want to defaultly select the age.

please tell me if any body knows

fredmv
11-17-2003, 08:21 AM
<select name="age" onchange="if( this.options[this.selectedIndex].value == '32' ) alert('32.');">