You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jacob Wilson <st...@yahoo.com> on 2003/10/20 06:21:22 UTC

question on javascript...

Hi...
 
This is a basic question... Can I find the index of a select box, if I have the value or the text ???
 
<select> 
<option value="A" selected>A</option>
<option value="B">B</option>
<option value="C">C</option>
</select>
 
If I have the value "A" or "B" or "C" -- Will it be possible for me to do something like this...
 
document.formName.optionName.options["C"].selected=true -- This won't work!!
 
Here, if I know the index of "C", I can make it selected....
 
Please let me know...
 
Thanks.
 


---------------------------------
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search