https://github.com/howardroark/data-validator
A tool for defining all of your form validation logic as data attributes.
https://github.com/howardroark/data-validator
Last synced: about 2 months ago
JSON representation
A tool for defining all of your form validation logic as data attributes.
- Host: GitHub
- URL: https://github.com/howardroark/data-validator
- Owner: howardroark
- License: unlicense
- Created: 2015-08-17T01:13:12.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-04-05T00:35:22.000Z (about 9 years ago)
- Last Synced: 2025-02-14T18:14:03.853Z (2 months ago)
- Language: JavaScript
- Homepage:
- Size: 10.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# data-validator
A module for defining all of your form validation logic as data attributes.### Why?
If anything is going to change on the fly it is your form validation requirements.
This module prevents you from having to dig into your JS files. It also makes it
easy to have localized error messaging.## Example
```html
```
##### Globals
```javascript
var errors = validator.validate({
form: '.form',
dump: '.errorList'
});if (errors.length < 1) {
// Carry on...
}
```##### CommonJS
```javascript
var validator = require('data-validator');var errors = validator.validate({
form: '.form',
dump: '.errorList'
});if (errors.length < 1) {
// Carry on...
}
```> Requires jQuery