Show Selected Option items : Option Select ComboBox : Form Control JAVASCRIPT DHTML TUTORIALS


JAVASCRIPT DHTML TUTORIALS » Form Control » Option Select ComboBox »

 

Show Selected Option items



<html>
<head>
<script language="JavaScript">
<!-- 
 function showSelected(f) {
  var selNum  = f.planets.selectedIndex;
  var selText = f.planets.options[selNum].text
  alert("Selection option selected: " + selNum + " " +"Selection option text: " + selText);
 }
//-->
</script>
</head>
<body>
<form name="mySelection">
Where <i>do</i> the Aliens exist?
<select name="planets">
<option>AA
<option selected>BB
<option>CC
</select>
<p>
<input type="button" value="See selection" onClick="showSelected(this.form)">
</form>
</body>
</html>



           
       



-

Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

JAVASCRIPT DHTML TUTORIALS

 Navioo Form Control
» Option Select ComboBox