The name of a form item is named submit or reset.

Source: Internet
Author: User

Recently, a friend used a form named as a keyword in form, causing the failure to reset and submit. It turned out to be the problem "an error is returned when document. forms [0]. reset () is called ?", Ask him right away: "Is there a form on the page ?", A: Yes ". "You alert document. forms [0]" and "the object is displayed ". That's strange. When does form have a reset method?
In the past, alert (document. forms [0]. reset) found that the object popped up is incorrect. The reset local method should pop up. Search for reset and find that the original reset button name is reset. No wonder an error occurs. document. forms [0]. reset points to the reset button instead of the reset interface of the form.

Remove name = "reset". Everything is OK!

In fact, it was also found that the name of its submit button is submit, and it is estimated that the submit method will also be wrong!
Khan: I don't know whether it is software or written by myself. Remember not to use these keywords to name them. It is easy to see unexpected errors!

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.