Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/firstandthird/valid

Javascript library to validate input fields in a form
https://github.com/firstandthird/valid

Last synced: 3 days ago
JSON representation

Javascript library to validate input fields in a form

Awesome Lists containing this project

README

        

#valid

Javascript library to validate input fields in a form

##Installation

###Bower

`bower install valid`

###Manual Download

- [Development]()
- [Production]()

##Usage

HTML:
```html

Name:
Email:

```

JS:
```javascript
var errors = valid($('form'));

if (errors) {
console.log(errors);
// format:
// [{ element: , type: 'required' }, { element: , type: 'pattern' }]
} else {
console.log('no errors');
}

```

##Development

###Requirements

- node and npm
- bower `npm install -g bower`
- grunt `npm install -g grunt-cli`

###Setup

- `npm install`
- `bower install`

###Run

`grunt dev`

or for just running tests on file changes:

`grunt ci`

###Tests

`grunt mocha`