Plugin Introduction
Let's start with a diagram:
: Https://github.com/nghuuphuoc/bootstrapvalidator
How to use: http://www.cnblogs.com/huangcong/p/5335376.html
Tips for using
Chinese Culture:
After the plugin is downloaded, the \js\bootstrapvalidator\language\zh_cn.js is introduced into the file, which implements the culture
Validate the form before submission:
A richer list of forms validation examples: http://www.jq22.com/yanshi522, directly on the code:
1 <! DOCTYPE html> 2 Look at line 331, click Submit, use
$ (' #defaultForm '). Bootstrapvalidator (' Validate ');
Single-Touch publication verification
Here is a pit that comes across:
Bootstrapvalidator The default logic is to turn the button gray when the form validation fails.
However, in the project, the button is not inside the form and is submitted via an event binding to Ajax. So here's the question:
The project needs to not perform the subsequent events that are bound when the form validation fails. Baidu half-day can not find relevant information, finally still rely on Google:
$ ("#yourform"). Submit (function (EV) {Ev.preventdefault ();}); $ ("#submit"). On ("click", Function () { var bootstrapvalidator = $ ("#yourform"). Data (' Bootstrapvalidator '); Bootstrapvalidator.validate (); if (Bootstrapvalidator.isvalid ()) $ ("#yourform"). Submit (); else return;});
Jiangzi can tell if the form validation has passed.
Transferred from: http://www.cnblogs.com/woodk/p/5546847.html
Bootstrap form validation plug-in Bootstrapvalidator use method collation