hwg-languages archives | May 2000 | new search | results | previous | next |
Re: JavaScript submit on select from dropdownby "Cyanide _7" <leo7278(at)hotmail.com> |
|
<SELECT size="1" NAME="ProductNumber" onChange="this.form.submit();"> <OPTION value=""> </OPTION> <OPTION value="page1.cfm">FormProcessOne</OPTION> <OPTION value="page2.cfm">FormProcessTwo</OPTION> </SELECT> - Cyanide_7 >I have a form with a dropdown menu. I want the form to submit when the user >selects an option on the menu. Here's a script that merely takes it to >another >page; perhaps it can be adapted to submit the form instead? > ><SCRIPT LANGUAGE="JavaScript"> >function goto_URL(object) { > window.location.href = object.options[object.selectedIndex].value; >} ></SCRIPT> > ><SELECT size="1" NAME="ProductNumber" >onChange="goto_URL(this.form.ProductNumber)"> ><OPTION value=""> </OPTION> ><OPTION value="page1.cfm">FormProcessOne</OPTION> ><OPTION value="page2.cfm">FormProcessTwo</OPTION> ></SELECT> > > - Keith Purtell > www.keithpurtell.com ________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
HWG: hwg-languages mailing list archives, maintained by Webmasters @ IWA