The best validation library for JavaScript.
40+ validators, 50+ plugins
<form id="registrationForm">
<input
name="userName"
data-fv-not-empty="true"
data-fv-not-empty___message="The username is required"
data-fv-string-length="true"
data-fv-string-length___min="6"
data-fv-string-length___message="The name must be more than 6 characters long"
/>
</form>
FormValidation.formValidation(
document.getElementById('registrationForm'),
{
fields: {
userName: {
validators: {
notEmpty: {
message: 'The username is required',
},
stringLength: {
message: 'The name must be more than 6 characters long',
min: 6,
},
},
},
},
},
);
and more!
Support the latest version of
This project is developed by Nguyen Huu Phuoc. I love building products and sharing knowledge.
Be my friend on