Form submit() Method
Form Object
Definition and Usage
The submit() method submits the form (same as clicking the Submit button).
Syntax
Browser Support

The submit() method is supported in all major browsers.
Example
Example
Create a button that submits the form:
<html>
<head>
<script>
function formSubmit()
{
document.getElementById("frm1").submit();
}
</script>
</head>
<body>
<form id="frm1" action="form_action.asp">
First name: <input type="text" name="fname"><br>
Last name: <input type="text" name="lname"><br>
<input type="button" onclick="formSubmit()" value="Submit
form">
</form>
</body>
</html>
Try it yourself »
Form Object
Thank You For Helping Us!
Your message has been sent to W3Schools.
Close [X]