JavaScript-Questions about bootstrap form validation

Source: Internet
Author: User
Background sets of bootstrap, about the style aspects of the most can be satisfied, which has a form submitted problems, set is ready-made bootstrap template. The code is as follows

   
  
   

About the method of form verification, the official website does not have any introduction, know what require mean, but want to know about this piece of introduction where to find, official website did not find. Thank you, everyone.

Because I wrote Ajax asynchronously to commit, not so. You want to do asynchronous commits in the same way that BS comes with a validation form. Thanks a lot

Reply content:

Background sets of bootstrap, about the style aspects of the most can be satisfied, which has a form submitted problems, set is ready-made bootstrap template. The code is as follows

   
  
   

About the method of form verification, the official website does not have any introduction, know what require mean, but want to know about this piece of introduction where to find, official website did not find. Thank you, everyone.

Because I wrote Ajax asynchronously to commit, not so. You want to do asynchronous commits in the same way that BS comes with a validation form. Thanks a lot

Simple.

$("form").submit(function(e){    e.preventDefault();   // disabled default action    // do something and ajax ....    $.post("url", $("form").serializeArray())    .done(function(){})    .failed(function(){})      });

Before you submit the form data to Ajax processing, write a function that validates the data before it is successfully delivered to Ajax, and the failure returns a prompt message.

The server address of the action is written in the form tag.

Search on GitHub, a lot, pick it yourself https://github.com/search?utf8=%E2%9C%93&q=Bootstrap+Validator

Can look at this page, JQuery Validate | Rookie Tutorial Http://www.runoob.com/jquery/jquery-plugin-validate.html

There are plugins that can help you do that.

  • 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.