🌜
🌞
validate-js

validate-js

v2.0.1

Lightweight JavaScript form validation library inspired by CodeIgniter.

npm install validate-js

README

validate.js

validate.js is a lightweight JavaScript form validation library inspired by CodeIgniter.

Features

  • Validate form fields from over a dozen rules
  • No dependencies
  • Customizable Messages
  • Supply your own validation callbacks for custom rules
  • Chainable customization methods for ease of declaration
  • Works in all major browsers, (even IE6!)
  • Modeled off the CodeIgniter form validation API

How to use

    var validator = new FormValidator('example_form', [{
        name: 'req',
        display: 'required',
        rules: 'required'
    }, {
        name: 'alphanumeric',
        rules: 'alpha_numeric'
    }, {
        name: 'password',
        rules: 'required'
    }, {
        name: 'password_confirm',
        display: 'password confirmation',
        rules: 'required|matches[password]'
    }, {
        name: 'email',
        rules: 'valid_email'
    }, {
        name: 'minlength',
        display: 'min length',
        rules: 'min_length[8]'
    }, {
        names: ['fname', 'lname'],
        rules: 'required|alpha'
    }], function(errors) {
        if (errors.length > 0) {
            // Show the errors
        }
    });

Documentation

You can view everything at http://rickharrison.github.com/validate.js

Browserify

It is published to npm under validate-js

npm install validate-js

Plugins

jQuery: https://github.com/magizh/validate_helper

Multi-Language Support

jnhwkim's fork added multi-language support viewable at https://github.com/jnhwkim/validate.js

Chinese - https://github.com/chilijung/validate.js

French - https://github.com/Facyla/validate.js

ghit.me

General

License
MIT
Typescript Types
None found
Tree-shakeable
No

Popularity

GitHub Stargazers
2,555
Community Interest
3,067
Number of Forks
411

Maintenance

Commits
10/219/2201
Last Commit
Dec 23, 2016
Open Issues
25
Closed Issues
108
Open Pull Requests
8
Closed Pull Requests
37

Versions

Versions Released
10/219/2201
Latest Version Released
Jan 19, 2016
Current Tags
latest2.0.1

Dependencies

Dependencies (0)
Dev Dependencies (0)

Contributors

rickharrison
rickharrison
Commits: 30
samccone
samccone
Commits: 2
mpchadwick
mpchadwick
Commits: 2
porada
porada
Commits: 2
mrgrain
mrgrain
Commits: 2
navruzm
navruzm
Commits: 2
websiteduck
websiteduck
Commits: 2
scottluptowski
scottluptowski
Commits: 2
thibaudcolas
thibaudcolas
Commits: 2
ikr
ikr
Commits: 2
deepakb
deepakb
Commits: 1
mkanev
mkanev
Commits: 1
benbrowning
benbrowning
Commits: 1
theraot
theraot
Commits: 1
Unkas
Unkas
Commits: 1