This article introduces the differences between js form submission and submit submission.
Untitled documentScript function test () {document. getElementById ("myform"). submit (); alert (11);} script
Note: When the get method is used to submit a form, values cannot be passed through the url in the action, and values can be passed through the post method in this way.
Differences between js submission and submit button submission:
1. When submitting a form in js, the value of the submit button is not included (because it is not clicked) in all browsers.
2. input and press enter to submit the w3c browser. The value of the submit button is not included in ie6.
Solution: Add a hidden domain and use this to determine whether or not to submit the data.
Bind a submission event on the submit button:
That is:
Will carry the value of submit, and the onsubmit status cannot be detected when submitting with js.
W3c: submit once
Ie6: submitted twice. js submitted in form first
Solution: If the button is submit, the onsubmit event is used for detection.
If the button is a button, the submit event is triggered after the detection succeeds.
Do not use js to submit the form, and then use onsubmit to detect
Simply use js to submit a form. alert and ff will block the submission of the form.
For details about the differences between js form submission and submit submission, refer to the PHP Chinese website!