input-validation
Very simple universal input validation module
This module has zero dependencies, is extensible and uses data attributes to target validation conditions
Getting Started
1. Installation (node)
npm install input-validation
2. Examples
var validatior handlers = { targetclassName = validator ? '' : 'invalid'; }
- data-required The user must supply some value to for the input to be valid
- data-valid-email The user must supply a loosely valid email for the input to be valid
Adding new validators
When extending input validation with new validators use camelCase without 'data' when specifying the attribute name.
var validatior ; validator
The user must supply an int value greater than 10
Copyright and license
Copyright (c) 2015-2016 Anycode lee@anycode.io
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.