HOw can I get the user input value using select on vbscript?
<select bblahblahblah onchange=dothis>
<option>
<option>
</select>
Printable View
HOw can I get the user input value using select on vbscript?
<select bblahblahblah onchange=dothis>
<option>
<option>
</select>
Its the same as Javascript really... but you're not familiar with Javascript then heres an example
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>VBScript Dom</title>
<script language="VBScript">
<!--
Function getSelect(objectID)
Msgbox ("Value " & document.getElementById(objectID).value & " selectedIndex " & document.getElementById(objectID).selectedIndex)
End Function
//-->
</script>
</head>
<body>
<select name="selectbox" id="selectbox" onchange="getSelect('selectbox')">
<option value="item1">Item1</option>
<option value="item2">Item2</option>
<option value="item3">Item3</option>
</select>
</body>
</html>
.value returns option value
.selectedIndex returns an number of the current selected item where 0 is the top