How to configure formvalidation
This article mainly introduces how to configure formvalidation, which is very detailed and has certain reference value. Friends who are interested must finish reading it!
Formvalidation is the best jQuery+Bootstrap form validation plug-in. This jQuery plug-in is very useful when you want to validate your forms when you create a website. It has many built-in options that are easy to use and understand. Support html5 attribute declaration to set input type, friendly verification pop-up or prompt error, input correct or not status icon display, dynamic and flexible message, good compatibility.
How to configure formvalidation
The member name is not an empty project configuration
Account
123456789
Data-bv-notempty indicates that the membership number should be an empty check.
Form-group 's div is required, otherwise a "toomuchrecursion" error will be reported.
The validateCallback method is executed when the form form is submitted, which is detailed in step 5.
Enable formvalidation after the page is loaded
$(function () {)
/ / validateform
$("form.required-validate") .each (function () {
Var$form=$ (this)
$form.bootstrapValidator ()
/ / repair bootstrapvalidator repeatedly submitting bug to the server
$form.on ('success.form.bv',function (e) {
/ / Preventformsubmission
E.preventDefault ()
})
})
})
The above is all the contents of this article "how to configure formvalidation". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!