SelectHTMLItemByValue - selects an item in a Combobox/Listbox within a Web page.

This undocumented function is similar to SelectHTMLItem(), except that it selects by value rather than item text.


Go to

Paste in the following, and click "Edit and Click Me >>":

<font class="small">Code:</font><hr /><pre>
&lt;select name="MySelect" size=4 multiple="multiple"&gt;
&lt;option value="a"&gt;Volvo&lt;/option&gt;
&lt;option value="b"&gt;Saab&lt;/option&gt;
&lt;option value="c"&gt;Mercedes&lt;/option&gt;
&lt;option value="d"&gt;Audi&lt;/option&gt;
</pre><hr />

Then run this script

<font class="small">Code:</font><hr /><pre>
UsePage("Tryit Editor v1.4")
SelectHTMLItemByValue("SELECT[NAME= 'MySelect']", "a")
SelectHTMLItemByValue("SELECT[NAME= 'MySelect']", "b", shift)
SelectHTMLItemByValue("SELECT[NAME= 'MySelect']", "d", ctrl)
</pre><hr />