Select List – Pick Item Choosen

[Total: 0    Average: 0/5]

This shows how to determine which item in a select list has been choose.

Body Code:

<form name=formname>
  <select name="txt1" 
          size=1 
		  onChange="JavaScript:doIt()">
    <option value="none">Select One or Two
    <option value="one">One
    <option value="two">Two
</select>
</form>
<script>
function doIt() {
var _x = document.formname.txt1.options[document.formname.txt1.selectedIndex].value;
alert("Value = "+_x);
}
</script>

Times Viewed: 0

Leave a Reply

Your email address will not be published. Required fields are marked *