Use form select control to trigger the action : Form Submit « Form Control « JavaScript DHTML






Use form select control to trigger the action

   

<HTML>
<BODY>
<FORM name="f1"> 
<SELECT name="s1"> 
<OPTION SELECTED value="http://www.java2s.com">Java2s.com
<OPTION value="http://www.google.com">Google
<OPTION value="http://www.msn.com">msn
<OPTION value="http://www.perl.com">Perl.com
<OPTION value="http://www.php.net">Php.net
</SELECT> 
<INPUT type="button" name="go" value="Go!" onClick="window.location=document.f1.s1.options[document.f1.s1.selectedIndex].value">
</FORM> 
<P>
<FORM name="f2"> 
<SELECT name="s2" onChange="window.location=document.f2.s2.options[document.f2.s2.selectedIndex].value"> 
<OPTION SELECTED value="http://www.java2s.com">Java2s.com
<OPTION value="http://www.google.com">Google
<OPTION value="http://www.msn.com">msn
<OPTION value="http://www.perl.com">Perl.com
<OPTION value="http://www.php.net">Php.net
</SELECT> 
</FORM> 

</BODY>

</HTML>

   
    
    
  








Related examples in the same category

1.Form Submit action
2.Return the method used when sending form data
3.Submit a form Via Enter
4.Convert a passed form reference to a string formatted like a JavaScript array of objects
5.form on submit event
6.Last-Minute Checking Before Form Submission
7.Use Image to trigger submit and reset actions
8.Submit a form by sending out an email
9.Adjusting a Server Submission Action
10.Demo: Ajax form submit
11.html input mask