An open API service indexing awesome lists of open source software.

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.

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