Menu
Hi everyone,
I am trying to automatically select a value in a pulldown menu based on the result of a SQL query.
For example if I have:
[code=html]<select name=”test”>
<option value=”joe”>Joe</option>
<option value=”chris”>Chris</option>
<option value=”mike”>Mike</option>
</select>
I know you can select any of these using selectedIndex, but is there a way to select by the text value since this is the data stored in the Database?
Basically I need a script that if the value is set to “mike” it selects mike (selectedIndex 2). The selection list in question is huge (over 100 records and changes often).
Thanks!