Combobox Change Event (VBScript):   Return to List

' The combobox below contains an onchange event that will, when a selection is made, set the indexes of several other combobox lists to 1 and a textbox (Other) to empty string.  This change event will fire -- even when a separate VBScript subroutine (Sub Autos_onChange()) will not.

<select name="Autos"
    onchange="vbscript:
    If Len(Autos(Autos.selectedIndex).text) > 0 Then
        Trucks.selectedIndex=1
        Motorcycles.selectedIndex=1
        Other.value = vbNullString
    End If">
<option><%= Server.HTMLEncode(Autos&"") %</option>
<option></option>
<option>Honda</option>
<option>Hyundai</option>
<option>Oldsmobile</option>
<option>Ford</option>
<option>Chrysler</option>
</select>



Note to Webmaster