Click a button to call submit on a form - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input Button

Description

Click a button to call submit on a form

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript">
    window.onload=function(){/*  w w  w.  j a  v a  2s  . c om*/
function submitform()
{
  document.myform.submit();
}
    }

      </script> 
   </head> 
   <body> 
      <form name="myform" action="handle-data.php">
          Search: 
         <input type="text" name="query"> 
         <button onclick="submitForm();">"&gt;Search</button> 
      </form>  
   </body>
</html>

Related Tutorials