| 776 |
lars |
1 |
[jQuery Validation Plugin](http://jqueryvalidation.org/) - Form validation made easy
|
|
|
2 |
================================
|
|
|
3 |
|
|
|
4 |
[](http://travis-ci.org/jzaefferer/jquery-validation)
|
|
|
5 |
[](https://david-dm.org/jzaefferer/jquery-validation#info=devDependencies)
|
|
|
6 |
|
|
|
7 |
The jQuery Validation Plugin provides drop-in validation for your existing forms, while making all kinds of customizations to fit your application really easy.
|
|
|
8 |
|
|
|
9 |
## [Help the project](http://pledgie.com/campaigns/18159)
|
|
|
10 |
|
|
|
11 |
[](http://pledgie.com/campaigns/18159)
|
|
|
12 |
|
|
|
13 |
This project is looking for help! [You can donate to the ongoing pledgie campaign](http://pledgie.com/campaigns/18159)
|
|
|
14 |
and help spread the word. If you've used the plugin, or plan to use, consider a donation - any amount will help.
|
|
|
15 |
|
|
|
16 |
You can find the plan for how to spend the money on the [pledgie page](http://pledgie.com/campaigns/18159).
|
|
|
17 |
|
|
|
18 |
## Getting Started
|
|
|
19 |
|
|
|
20 |
### Downloading the prebuilt files
|
|
|
21 |
|
|
|
22 |
Prebuilt files can be downloaded from http://jqueryvalidation.org/
|
|
|
23 |
|
|
|
24 |
### Downloading the latest changes
|
|
|
25 |
|
|
|
26 |
The unreleased development files can be obtained by:
|
|
|
27 |
|
|
|
28 |
1. [Downloading](https://github.com/jzaefferer/jquery-validation/archive/master.zip) or Forking this repository
|
|
|
29 |
2. [Setup the build](CONTRIBUTING.md#build-setup)
|
|
|
30 |
3. Run `grunt` to create the built files in the "dist" directory
|
|
|
31 |
|
|
|
32 |
### Including it on your page
|
|
|
33 |
|
|
|
34 |
Include jQuery and the plugin on a page. Then select a form to validate and call the `validate` method.
|
|
|
35 |
|
|
|
36 |
```html
|
|
|
37 |
<form>
|
|
|
38 |
<input required>
|
|
|
39 |
</form>
|
|
|
40 |
<script src="jquery.js"></script>
|
|
|
41 |
<script src="jquery.validate.js"></script>
|
|
|
42 |
<script>
|
|
|
43 |
$("form").validate();
|
|
|
44 |
</script>
|
|
|
45 |
```
|
|
|
46 |
|
|
|
47 |
Alternatively include jQuery and the plugin via requirejs in your module.
|
|
|
48 |
|
|
|
49 |
```js
|
|
|
50 |
define(["jquery", "jquery.validate"], function( $ ) {
|
|
|
51 |
$("form").validate();
|
|
|
52 |
});
|
|
|
53 |
```
|
|
|
54 |
|
|
|
55 |
For more information on how to setup a rules and customizations, [check the documentation](http://jqueryvalidation.org/documentation/).
|
|
|
56 |
|
|
|
57 |
## Reporting issues and contributing code
|
|
|
58 |
|
|
|
59 |
See the [Contributing Guidelines](CONTRIBUTING.md) for details.
|
|
|
60 |
|
|
|
61 |
**IMPORTANT NOTE ABOUT EMAIL VALIDATION**. As of version 1.12.0 this plugin is using the same regular expression that the [HTML5 specification suggests for browsers to use](https://html.spec.whatwg.org/multipage/forms.html#valid-e-mail-address). We will follow their lead and use the same check. If you think the specification is wrong, please report the issue to them. If you have different requirements, consider [using a custom method](http://jqueryvalidation.org/jQuery.validator.addMethod/).
|
|
|
62 |
|
|
|
63 |
## License
|
|
|
64 |
Copyright © Jörn Zaefferer<br>
|
|
|
65 |
Licensed under the MIT license.
|