├── .gitignore
├── .gitmodules
├── .versions
├── README.md
├── package.js
├── themeteorchef:jquery-validation-tests.js
└── versions.json
/.gitignore:
--------------------------------------------------------------------------------
1 | .build*
2 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "lib/jquery-validation"]
2 | path = lib/jquery-validation
3 | url = https://github.com/jzaefferer/jquery-validation
4 |
--------------------------------------------------------------------------------
/.versions:
--------------------------------------------------------------------------------
1 | base64@1.0.3
2 | binary-heap@1.0.3
3 | callback-hook@1.0.3
4 | check@1.0.5
5 | ddp@1.1.0
6 | ejson@1.0.6
7 | geojson-utils@1.0.3
8 | id-map@1.0.3
9 | jquery@1.11.3_2
10 | json@1.0.3
11 | local-test:themeteorchef:jquery-validation@1.14.0
12 | logging@1.0.7
13 | meteor@1.1.6
14 | minimongo@1.0.8
15 | mongo@1.1.0
16 | ordered-dict@1.0.3
17 | random@1.0.3
18 | retry@1.0.3
19 | test-helpers@1.0.4
20 | themeteorchef:jquery-validation@1.14.0
21 | tinytest@1.0.5
22 | tracker@1.0.7
23 | underscore@1.0.3
24 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | +++++ DEPRECATION NOTICE +++++
2 |
3 | This package is no longer being maintained. **It's recommended that you rely on the official jquery-validation package via NPM**.
4 |
5 | **To get it**: `npm install --save jquery-validation`
6 |
7 | ---
8 |
9 | ## jQuery Validation for Meteor
10 |
11 | Meteor implementation of [Validation](https://github.com/jzaefferer/jquery-validation) for jQuery.
12 |
13 | ## Usage
14 |
15 | Install via [Atmosphere](http://atmospherejs.com):
16 |
17 | ` meteor add themeteorchef:jquery-validation`
18 |
19 | ### Basic Implementation
20 |
21 | There are a number of ways to validate your forms. The first and most simplistic is to use the helper classes provided by jQuery Validation in your markup. In the following example, the `.required` and `.email` classes are being used. On the name input, the `class="required"` attribute tells jQuery Validation that this field is required. If a user fails to type anything into this field, an error will be thrown.
22 |
23 | On the second field (`name="emailAddress"`), we see two classes in use: `class="required email"`. Similar to the first field, this means that a value is required in this field, but *also* means that the user's input needs to be a valid email address (e.g. `email@website.com` and not `aetoiuetoi90385135`).
24 |
25 | Add the "required" class to your markup:
26 |
27 | ```
28 |
29 |
36 |
37 | ```
38 |
39 | Back in our Meteor code, we enable validation by using the `.validate()` method provided by jQuery Validation in our template's rendered function:
40 |
41 | ```
42 | Template.exampleForm.onRendered( function() {
43 | $( "#example-form" ).validate();
44 | });
45 | ```
46 |
47 | ### Advanced Implementation
48 |
49 | If need be, you can make use of all of [jQuery Validation's methods](http://jqueryvalidation.org/validate). To use them in your Meteor app, see the example below for adding validation to the login form in [Base](http://themeteorchef.com/base).
50 |
51 | First, our markup. Note: instead of adding classes, we're only using bare markup here. jQuery Validation relies on the `name` attribute of our form fields to define rules.
52 |
53 | ```
54 |
55 | Don't have an account? Sign Up.Login
58 |
71 |