Hi,

This is what I am trying to do:

<Select name ="test">
<option value="me">me</option>
<option value="you">you</option>
<option value="us">us</option>
</Select>


document.form.test.options[getIndexof('us')].selected = true;

Coz I actually I want to do this:

var value = r.select; //reading value from database.
document.form.test.options[getIndexof(value)].selected = true;

So basically, I pass the value of an option and find out the index for that option and make that index the selectedindex.

Is there something already out there that can do it or do I have to write my own getIndxof(value)???

Any help is appreciated. Thank you