The best validation library for JavaScript.
40+ validators, 50+ plugins
- Cover most various types of form field
- Develop, reuse custom validator
- Support sync and async validators
- Plugin based architectue
- Customize icon
- Customize error message
- Customize error message location
- Customize valid and invalid colors
- Dynamic field
- Enable, disable validators on the fly
- Language packages for error message
- Support custom message
- Support custom validators
- Switch between locales
- Validate ID and VAT numbers in many countries
- Declarative mode
<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>
- Programmatic mode
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,
},
},
},
},
},
);
- Support native form
- Support popular CSS frameworks via plugins
- Support popular JavaScript frameworks
- Easy to integrate with a framework
- Autocomplete
- Color picker
- Custom checkbox
- Custom radio
- Date picker
- International telephone input
- Mask input
- Rich editor
- Select
- Star rating
- Tag input
- Time picker
- Toggle
- Wizard
and more!
Support the latest version of
- Chrome
- Firefox
- Safari
- Opera
- Edge
- Internet Explorer 11
This project is developed by Nguyen Huu Phuoc. I love building products and sharing knowledge.
Be my friend on