How To Submit a Form Using JavaScript Automatically
A form is submitted when a user clicks a submit button (or link). This means the form is filled out and ready to be posted to the action source. However, there may be times when you would like to submit a form automatically such as when a timer runs out for a test.
Whatever the reason may be, JavaScript makes it easy to submit an HTML form automatically. Using the id of the form, you can use submit() to pragmatically submit the form.
How To Submit a Form Using JavaScript Automatically
Using submit, you submit a form like this:
Easy huh?
Example Form and Submit
And submit it via JavaScript:
This example JavaScript code shows how to submit a form when a hyperlink is clicked using the HTML from above:
Feel free to post any questions you have![/cc]
2 Responses
12.17.2011
Very simple and usefull. Many thanks