Full version: jsB@nk » Form » Dropdown » Multi Value Drop Down List
URL: https://www.javascriptbank.com/multi-value-drop-down-list.html
Using a drop-down menu, this script will provide different values, depending on the user's selection. Easily added to any form.
Full version: jsB@nk » Form » Dropdown » Multi Value Drop Down List
URL: https://www.javascriptbank.com/multi-value-drop-down-list.html
<script language="javascript">// Created by: Jay Rumsey | http://www.nova.edu/~rumsey/function ShowReg(op) { document.getElementById('Car').style.display='none'; document.getElementById('Boat').style.display='none'; document.getElementById('Plane').style.display='none'; if (op == 1) { document.getElementById('Car').style.display="block"; } if (op == 2) { document.getElementById('Boat').style.display="block"; } if (op == 3) { document.getElementById('Plane').style.display="block"; }}</script><!-- This script downloaded from www.JavaScriptBank.com Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->
<select id="choice" onChange="ShowReg(this.selectedIndex)"> <option value='0'>Select registration type <option value="1">Car <option value="2">Boat <option value="3">Plane</select><br><div id="Car" style="display:none"> VIN No. <input type="text" id="VIN" value=""></div><div id="Boat" style="display:none"> Registration No. <input type="text" id="Breg" value=""></div><div id="Plane" style="display:none"> Tail No. <input type="text" id="Ptail" value=""> Model <input type="text" id="Pmodel" value=""></div><!-- This script downloaded from www.JavaScriptBank.com Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->