Javascript-why can this code be submitted?

Source: Internet
Author: User
At the beginning, I started the experiment with the following short code. onsubmit & quot; returnfalse & quot; in this way, the direct returnfalse is used to prevent form submission. in this way, clicking the button does not respond. later, I changed it to a function to prevent form submission. the code below is changed... at the beginning, I started an experiment with the following short code. onsubmit = "return false" was written in this way. return false was used directly to prevent form submission. in this way, the button was clicked without any response. I changed the form to a function to prevent form submission. the code below is changed to this way. Others say that form submission can be blocked, but I cannot try it. clicking the button does not mean that a page will appear after I click it. refresh and the address bar will be followed by another address? The second part of the code is different from the previous direct return false. in this case, onsubmit = "return check () is used () "If you do not enter anything, click submit directly or submit it to the database. it does not prevent the submission. who knows what is wrong with my code? why cannot I stop the submission?

        

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.