Form.submit () error reasons and solutions for not submitting forms _javascript tips

Source: Internet
Author: User

Go directly to the code:

<div id= "Register" >  

The result is that the test for a long time did not see the message, think that the code is wrong or wrong way to write, carefully check, in the results of the official document, confirm that there is no error.

Formid.submit () cannot submit, temporarily had to change the type of btnsubmit to submit

This.type= "Submit"

The information was found on the internet, due to two points:

1, the form cannot have name= "submit" the label

2, the form can not be lack of "enctype=" Multipart/form-data "

After testing, this two point is absurd, and did not solve my problem (perhaps my problem environment is not the same)

Later, thought the forum friend suggested that I change the registration button ID name, do not submit. After correction, the form is submitted normally, prompting for information to appear.

Finally, the ID of the button is not set to submit, or it may cause confusion, resulting in the form's submit () method not submitting the form. When naming IDs, it is best not to repeat names with existing APIs to avoid unnecessary annoyance.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.