Inmagic Forums
Inmagic Forums
WebPublisher PRO
how to get dropdown menu to submit into database|
Go
![]() |
New
![]() |
Find
![]() |
Notify
![]() |
Tools
![]() |
Reply
![]() |
|
This is the script for the 2 menus:
<script type="text/javascript"> function setOptions(chosen) { var selbox = document.myform.opttwo; selbox.options.length = 0; if (chosen == "1") { selbox.options[selbox.options.length] = new Option('area of law 1','onetwo'); selbox.options[selbox.options.length] = new Option('area of law 2','onetwo'); } if (chosen == "2") { selbox.options[selbox.options.length] = new Option('sub-area of law 1','twoone'); selbox.options[selbox.options.length] = new Option('sub-area of law 2','twotwo'); selbox.options[selbox.options.length] = new Option('sub-area of law 3','twothree'); } } </script> <form name="myform"> <div align="left"> <select name="optone" size="1" onchange="setOptions(document.myform.optone.options[document.myform.optone.selectedIndex].value);"> <option value=" " selected="selected"> Area of Law </option> <option value="1">Corporate Governance</option> </select> </div> <div align="left"> <select name="opttwo" size="5" multiple> <option value=" 2" selected="selected">Sub-Area of Law</option> </div></form> These are the 2 fields we want to submit to: <div> <input id="EF41" name="EF41" type="hidden" value="AreaOfLaw" /> <input id="EI41" name="EI41" class="FC4" tabindex="51" onchange="bc()" onfocus="bf(this,1,1,1)" onblur="bb(this)" onkeypress="kp(this)" onkeyup="ku(this)" style="background-color:rgb(255,255,255); position:absolute; left:297px; top:661px; width:216px; height:24" value="" /> </div> <div> <input id="EF42" name="EF42" type="hidden" value="Sub-AreaOfLaw" /> <input id="EI42" name="EI42" class="FC4" tabindex="52" onchange="bc()" onfocus="bf(this,1,1,1)" onblur="bb(this)" onkeypress="kp(this)" onkeyup="ku(this)" style="background-color:rgb(255,255,255); position:absolute; left:646px; top:661px; width:362px; height:24" value="" /> </div> This message has been edited. Last edited by: anneb, |
|||
|
| Powered by Eve Community |
| Please Wait. Your request is being processed... |
|
Inmagic Forums
Inmagic Forums
WebPublisher PRO
how to get dropdown menu to submit into database
