Javascript examples for DOM HTML Element:Form
The submit() method submits the form.
The following code shows how to Submit a form:
<!DOCTYPE html> <html> <body> <form id="myForm" action="#"> First name: <input type="text" name="fname"><br> Last name: <input type="text" name="lname"><br><br> <input type="button" onclick="myFunction()" value="Submit form"> </form>// ww w . j a va 2s . c o m <script> function myFunction() { document.getElementById("myForm").submit(); } </script> </body> </html>