The difference between js form submission and submit submission

高洛峰
Release: 2016-12-16 15:12:38
Original
1582 people have browsed it

    无标题文档 
   
Copy after login

Note: When submitting the form in the get method, the url value cannot be passed in the action. Post can be passed like this


The difference between js submission and submit button submission:

1. js will not be used when submitting the form The value of the submit button (because it has not been clicked) in all browsers

2. Press Enter to submit. The w3c browser will bring the value of the submit button, but ie6 will not.

Solution: Add a hidden domain, Use this to judge, no matter which method is used to submit, there will be a value


Bind the submit event on the submit button:

That is:

will bring the value of submit, and the onsubmit status cannot be detected when submitting with js

w3c: Submit once

ie6: Submit in two times, submit js in the form first

Solution: If the button is submit, use onsubmit event detection when detecting

If the button is button, the submit event will be triggered after the detection is passed

Be sure not to use js to submit the form, and then use onsubmit to detect


Simply use js to submit the form, alert, ff will block the submission of the form, while other browsers


For more related articles on the difference between js form submission and submit submission, please pay attention to the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!