|
10 | 10 |
|
11 | 11 | git checkout master |
12 | 12 |
|
13 | | -## What's New ? |
| 13 | +## Why this ? |
14 | 14 |
|
15 | 15 | * Support **Native** and **ES6** Javascript, |
16 | 16 | * Pure Javascript Code (**No Dependency**), |
17 | 17 | * Simplified Implementations, |
18 | 18 | * **HTML 5 validation** for all Browsers, |
19 | | - * Reliable and **Dynamic** level **DOM** Validations. |
| 19 | + * Reliable and **Dynamic** level **DOM** Validations, |
| 20 | + * Dynamic auto scroll with element. |
20 | 21 |
|
21 | 22 |
|
22 | 23 | **Steps to Integrate to Form :** |
|
29 | 30 |
|
30 | 31 | Then Integrate your form with Validator. |
31 | 32 |
|
32 | | - |
33 | 33 | ```javascript |
34 | | - |
35 | | - // For Native-Javascript |
36 | | - var myform = jsValidator.init({ |
| 34 | + |
| 35 | + // Core |
| 36 | + var myform = jsValidator.init({ |
37 | 37 | form: 'form2submit', // #id |
38 | | - forceFilter: true, |
39 | | - message: { |
40 | | - required: 'This field is required !', |
41 | | - min: '<br><span style="color: red;">This field is less then the limit [INDEX]</span>', |
42 | | - max: 'This field is exceeds the limit of [INDEX]', |
43 | | - password: 'Password doesn\'t match !', |
44 | | - email: 'Invalid Email found !' |
45 | | - } |
46 | 38 | }); |
47 | 39 |
|
48 | | - // For ES6 |
49 | | - var myform = new jsValidator().init({ |
| 40 | + // ES6 |
| 41 | + var myform = new jsValidator().init({ |
50 | 42 | form: 'form2submit', // #id |
51 | | - forceFilter: true, |
52 | | - message: { |
53 | | - required: 'This field is required !', |
54 | | - min: '<br><span style="color: red;">This field is less then the limit [INDEX]</span>', |
55 | | - max: 'This field is exceeds the limit of [INDEX]', |
56 | | - password: 'Password doesn\'t match !', |
57 | | - email: 'Invalid Email found !' |
58 | | - } |
59 | 43 | }); |
60 | | - |
| 44 | + |
61 | 45 | ``` |
| 46 | + |
| 47 | + |
| 48 | + |
62 | 49 | ## Options |
63 | 50 |
|
64 | 51 | | Name | Values | Descriptions | Mandatory | |
@@ -101,7 +88,7 @@ Then Integrate your form with Validator. |
101 | 88 | |
102 | 89 | Currently the validation will trigger on submit button trigger. |
103 | 90 |
|
104 | | -It has automated listener to eliminating unnecessary changes on form. |
| 91 | +It has automated listener to monitor every changes on form. |
105 | 92 |
|
106 | 93 | **Note:** |
107 | 94 |
|
@@ -189,8 +176,40 @@ It has automated listener to eliminating unnecessary changes on form. |
189 | 176 | </form> |
190 | 177 | ``` |
191 | 178 |
|
| 179 | +#### Sample |
| 180 | + |
| 181 | +```javascript |
| 182 | + |
| 183 | + // For Native-Javascript |
| 184 | + var myform = jsValidator.init({ |
| 185 | + form: 'form2submit', // #id |
| 186 | + forceFilter: true, |
| 187 | + message: { |
| 188 | + required: 'This field is required !', |
| 189 | + min: '<br><span style="color: red;">This field is less then the limit [INDEX]</span>', |
| 190 | + max: 'This field is exceeds the limit of [INDEX]', |
| 191 | + password: 'Password doesn\'t match !', |
| 192 | + email: 'Invalid Email found !' |
| 193 | + } |
| 194 | + }); |
| 195 | + |
| 196 | + // For ES6 |
| 197 | + var myform = new jsValidator().init({ |
| 198 | + form: 'form2submit', // #id |
| 199 | + forceFilter: true, |
| 200 | + message: { |
| 201 | + required: 'This field is required !', |
| 202 | + min: '<br><span style="color: red;">This field is less then the limit [INDEX]</span>', |
| 203 | + max: 'This field is exceeds the limit of [INDEX]', |
| 204 | + password: 'Password doesn\'t match !', |
| 205 | + email: 'Invalid Email found !' |
| 206 | + } |
| 207 | + }); |
| 208 | + |
| 209 | +``` |
192 | 210 | |
193 | | -It Will listen the **Submit** button event **Automatically**. |
| 211 | +It Will listen the **Submit** event **Automatically** and initiating the validation checks. |
| 212 | +And based on response, it will allow to submit or throw messages. |
194 | 213 |
|
195 | 214 |
|
196 | 215 | License |
|
0 commit comments