https://github.com/niceue/nice-validator
Simple, smart and pleasant validation solution.
https://github.com/niceue/nice-validator
form-validation javascript jquery-plugin nice validate validation validator
Last synced: 28 days ago
JSON representation
Simple, smart and pleasant validation solution.
- Host: GitHub
- URL: https://github.com/niceue/nice-validator
- Owner: niceue
- Created: 2013-04-16T08:08:31.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2023-09-13T09:26:16.000Z (over 2 years ago)
- Last Synced: 2025-05-16T10:05:53.108Z (8 months ago)
- Topics: form-validation, javascript, jquery-plugin, nice, validate, validation, validator
- Language: JavaScript
- Homepage: http://niceue.github.io/nice-validator/
- Size: 2.48 MB
- Stars: 609
- Watchers: 60
- Forks: 146
- Open Issues: 20
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# nice-validator
[](https://travis-ci.org/niceue/nice-validator)
[](https://github.com/niceue/nice-validator/releases)
[](https://www.npmjs.com/package/nice-validator)
[](http://niceue.com/licenses/MIT-LICENSE.txt)
Simple, smart and pleasant validation solution.
[Download](https://github.com/niceue/nice-validator/releases) the latest release
or install package via [npm](https://www.npmjs.com/) or [bower](http://bower.io/)
```bash
$ npm install nice-validator
```
```bash
$ bower install nice-validator
```
## Getting started
#### 1. Include [jQuery 1.7+](http://jquery.com)
#### 2. Include nice-validator
width `` tag:
```html
<script src="path/to/nice-validator/jquery.validator.min.js?local=en">
```
via [webpack](http://webpack.github.io/)
```javascript
require('nice-validator')
require('nice-validator/local/zh-CN')
```
via module loader [Requirejs](http://requirejs.org/):
```javascript
requirejs.config({
paths: {
jquery: 'http://cdn.jsdelivr.net/jquery/1.12.3/jquery.min',
validator: 'path/to/nice-validator/local/en'
},
shim: {
validator: ['path/to/nice-validator/jquery.validator.js?css']
}
});
require(['validator']);
```
#### 3. Config rules
```html
... yadda yadda ...
```
It has started to work when you use native submitting.
#### 4. Handle submit (Optional)
```javascript
$("#form1").on('valid.form', function(){
// You can do something, then submit form by native
// this.submit();
// or submit form by ajax
$.post("path/to/server", $(this).serialize())
.done(function(d){
// do something
});
});
```
## Documention
- [English](https://github.com/niceue/nice-validator/wiki/Getting-Started)
- [简体中文](http://validator.niceue.com/)
## Browser Support
* IE6+
* Chrome
* Safari 4+
* Firefox 9+
* Opera
## Bugs / Contributions
- [Report a bug](https://github.com/niceue/nice-validator/issues)
- To contribute or send an idea, github message me or fork the project
## Build
Install dependencies:
```bash
$ npm install -g gulp
$ npm install
```
Run test and build:
```bash
$ gulp
```
## License
nice-validator is available under the terms of the [MIT License](http://niceue.com/licenses/MIT-LICENSE.txt).