Giter Club home page Giter Club logo

FormValidation

The best validation library for JavaScript.

FormValidation

Biggest collection of validators

40+ validators, 50+ plugins

  • Cover most various types of form field
  • Develop, reuse custom validator
  • Support sync and async validators
  • Plugin based architectue

Flexible

  • Customize icon
  • Customize error message
  • Customize error message location
  • Customize valid and invalid colors
  • Dynamic field
  • Enable, disable validators on the fly

Localization

  • Language packages for error message
  • Support custom message
  • Support custom validators
  • Switch between locales
  • Validate ID and VAT numbers in many countries

Declaring validation rules

  • 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,                        
                    },
                },
            },
        },
    },
);

Integration with your stack

  • Support native form
  • Support popular CSS frameworks via plugins
  • Support popular JavaScript frameworks
  • Easy to integrate with a framework

Play nice with form libraries

  • 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!

Supported browsers

Support the latest version of

  • Chrome
  • Firefox
  • Safari
  • Opera
  • Edge
  • Internet Explorer 11

About

This project is developed by Nguyen Huu Phuoc. I love building products and sharing knowledge.

Be my friend on

FormValidation's Projects

examples icon examples

A collection of useful FormValidation examples

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.