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.