Form.submit()
JavaScript 1.0+, JScript 1.0+ Nav2+, IE 3+, Opera3+ Syntax
form.submit()
Description
The submit method of the Form object is used to submit a form. It operates the same as if a Submit button was clicked.
Example
Listing 7.266 shows how you would submit a form using the submit() method. The form is submitted to the value specified in the ACTION attribute of the HTML <form> tag. In this specific example, a made up script processes the form.
Listing 7.266 Accessing the submit() Method
<html> <head> <title> Using the submit method for the Form object</title> </head> <body> <script language="JavaScript"> <!-- Hide // function submits a form to a server specified in the <form> tag function submitForm(form){ document.form1.submit(form); ... |
Get Pure JavaScript now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.