|
29 | 29 |
|
30 | 30 | Then Integrate your form with Validator. |
31 | 31 |
|
32 | | - |
33 | 32 | ```javascript |
34 | | - |
35 | | - // For Native-Javascript |
36 | | - var myform = jsValidator.init({ |
| 33 | + |
| 34 | + // Core |
| 35 | + var myform = jsValidator.init({ |
37 | 36 | 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 | 37 | }); |
47 | 38 |
|
48 | | - // For ES6 |
49 | | - var myform = new jsValidator().init({ |
| 39 | + // ES6 |
| 40 | + var myform = new jsValidator().init({ |
50 | 41 | 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 | 42 | }); |
60 | | - |
| 43 | + |
61 | 44 | ``` |
| 45 | + |
| 46 | + |
| 47 | + |
62 | 48 | ## Options |
63 | 49 |
|
64 | 50 | | Name | Values | Descriptions | Mandatory | |
@@ -101,7 +87,7 @@ Then Integrate your form with Validator. |
101 | 87 | |
102 | 88 | Currently the validation will trigger on submit button trigger. |
103 | 89 |
|
104 | | -It has automated listener to eliminating unnecessary changes on form. |
| 90 | +It has automated listener to monitor every changes on form. |
105 | 91 |
|
106 | 92 | **Note:** |
107 | 93 |
|
@@ -189,6 +175,37 @@ It has automated listener to eliminating unnecessary changes on form. |
189 | 175 | </form> |
190 | 176 | ``` |
191 | 177 |
|
| 178 | +#### Sample |
| 179 | + |
| 180 | +```javascript |
| 181 | + |
| 182 | + // For Native-Javascript |
| 183 | + var myform = jsValidator.init({ |
| 184 | + form: 'form2submit', // #id |
| 185 | + forceFilter: true, |
| 186 | + message: { |
| 187 | + required: 'This field is required !', |
| 188 | + min: '<br><span style="color: red;">This field is less then the limit [INDEX]</span>', |
| 189 | + max: 'This field is exceeds the limit of [INDEX]', |
| 190 | + password: 'Password doesn\'t match !', |
| 191 | + email: 'Invalid Email found !' |
| 192 | + } |
| 193 | + }); |
| 194 | + |
| 195 | + // For ES6 |
| 196 | + var myform = new jsValidator().init({ |
| 197 | + form: 'form2submit', // #id |
| 198 | + forceFilter: true, |
| 199 | + message: { |
| 200 | + required: 'This field is required !', |
| 201 | + min: '<br><span style="color: red;">This field is less then the limit [INDEX]</span>', |
| 202 | + max: 'This field is exceeds the limit of [INDEX]', |
| 203 | + password: 'Password doesn\'t match !', |
| 204 | + email: 'Invalid Email found !' |
| 205 | + } |
| 206 | + }); |
| 207 | + |
| 208 | +``` |
192 | 209 | |
193 | 210 | It Will listen the **Submit** button event **Automatically**. |
194 | 211 |
|
|
0 commit comments