Selecting an Option Using JavaScript : Option Select ComboBox : Form Control JAVASCRIPT DHTML TUTORIALS


JAVASCRIPT DHTML TUTORIALS » Form Control » Option Select ComboBox »

 

Selecting an Option Using JavaScript



<html>
<head>
<script language = "JavaScript">
     function quickSelect() {
          var bnd = document.form1.band.value
          bnd = bnd.toUpperCase()
          if (bnd == "OASIS") {
               document.form1.songs[4].selected = "1"
          }
     }
</script>
</head>
<body>
    <form name="form1">
        Favorite Band: 
        <input type=text name="band" size=20 onBlur="quickSelect()"><p>
        Songs: <select NAME="songs" SIZE=1>
        <option VALUE="Liquid">A</option>
        <option VALUE="World's Apart">B</option>
        <option VALUE="Ironic">C</option>
        <option VALUE="1979">D</option>
        <option VALUE="Wonderwall">E</option>
        <option VALUE="F">F</option>
        </SELECT><p>
        <input type=button value="Show Current" onClick="quickSelect()">
    </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