Visual InterDev
Selects an item based on the VALUE attribute.
Syntax
object.selectByValue(value)
Parameters
object
A Listbox or OptionGroup script object.
value
A string that corresponds to the HTML VALUE attribute.
Remarks
Returns the index of the selected item if successful, and -1 if not successful.
Use the selectByText method to select an item based on the item's text.
Example
In the following example, the event handler adds items to an existing Listbox named Listbox1 and sets the default selection to "Cars" each time thisPage is first processed on the server.
function thisPage_onenter()
{
ListBox1.addItem("Cars", 1);
ListBox1.addItem("Planes", 2);
ListBox1.addItem("Trains", 3);
ListBox1.selectByValue(1);
}