/
formvalid-en.hbs
446 lines (420 loc) · 21.6 KB
/
formvalid-en.hbs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
---
{
"title": "Form validation",
"language": "en",
"category": "Plugins",
"description": "Provides generic validation and error message handling for Web forms.",
"tag": "formvalid",
"parentdir": "formvalid",
"altLangPrefix": "formvalid",
"dateModified": "2015-07-17"
}
---
<section>
<h2>Purpose</h2>
<p>Provides generic validation and error message handling for Web forms.</p>
</section>
<section>
<h2>Example</h2>
<div class="wb-frmvld">
<form action="#" method="get" id="validation-example">
<fieldset>
<legend>Contact information</legend>
<div class="form-group">
<label for="title1" class="required"><span class="field-name">Title</span> <strong class="required">(required)</strong></label>
<select class="form-control" id="title1" name="title1" required="required">
<option label="Select a title"></option>
<option value="dr">Dr.</option>
<option value="esq">Esq.</option>
<option value="mr">Mr.</option>
<option value="ms">Ms.</option>
</select>
</div>
<details class="mrgn-bttm-md">
<summary>View code</summary>
<pre><code><div class="wb-frmvld">
<form action="#" method="get" id="validation-example">
...
<div class="form-group">
<label for="title1" class="required"><span class="field-name">Title</span> <strong class="required">(required)</strong></label>
<select class="form-control" id="title1" name="title1" required="required">
<option label="Select a title"></option>
<option value="dr">Dr.</option>
<option value="esq">Esq.</option>
<option value="mr">Mr.</option>
<option value="ms">Ms.</option>
</select>
</div></code></pre>
</details>
<div class="form-group">
<label for="fname1" class="required"><span class="field-name">First name</span> <strong class="required">(required)</strong></label>
<input class="form-control" id="fname1" name="fname1" type="text" required="required" pattern=".{2,}" data-rule-minlength="2" />
</div>
<details class="mrgn-bttm-md">
<summary>View code</summary>
<pre><code><div class="wb-frmvld">
<form action="#" method="get" id="validation-example">
...
<div class="form-group">
<label for="fname1" class="required"><span class="field-name">First name</span> <strong class="required">(required)</strong></label>
<input class="form-control" id="fname1" name="fname1" type="text" required="required" pattern=".{2,}" data-rule-minlength="2" />
</div></code></pre>
</details>
<div class="form-group">
<label for="lname1" class="required"><span class="field-name">Last name</span> <strong class="required">(required)</strong></label>
<input class="form-control" id="lname1" name="lname1" type="text" required="required" pattern=".{2,}" data-rule-minlength="2" />
</div>
<details class="mrgn-bttm-md">
<summary>View code</summary>
<pre><code><div class="wb-frmvld">
<form action="#" method="get" id="validation-example">
...
<div class="form-group">
<label for="lname1" class="required"><span class="field-name">Last name</span> <strong class="required">(required)</strong></label>
<input class="form-control" id="lname1" name="lname1" type="text" required="required" pattern=".{2,}" data-rule-minlength="2" />
</div></code></pre>
</details>
<div class="form-group">
<label for="tel1" class="required"><span class="field-name">Telephone number (including area code)</span> <strong class="required">(required)</strong></label>
<input class="form-control" id="tel1" name="tel1" type="tel" required="required" data-rule-phoneUS="true" />
</div>
<details class="mrgn-bttm-md">
<summary>View code</summary>
<pre><code><div class="wb-frmvld">
<form action="#" method="get" id="validation-example">
...
<div class="form-group">
<label for="tel1" class="required"><span class="field-name">Telephone number</span> <strong class="required">(required)</strong></label>
<input class="form-control" id="tel1" name="tel1" type="tel" required="required" data-rule-phoneUS="true" />
</div></code></pre>
</details>
<div class="form-group">
<label for="ext1"><span class="field-name">Telephone extension</span></label>
<input class="form-control" id="ext1" name="ext1" type="number" data-rule-extension="true" />
</div>
<details class="mrgn-bttm-md">
<summary>View code</summary>
<pre><code><div class="wb-frmvld">
<form action="#" method="get" id="validation-example">
...
<div class="form-group">
<label for="ext1"><span class="field-name">Telephone extension</span></label>
<input class="form-control" id="ext1" name="ext1" type="number" required="required" data-rule-extension="true" />
</div></code></pre>
</details>
<div class="form-group">
<label for="pcodeca1" class="required"><span class="field-name">Postal code (Canada)</span> <strong class="required">(required)</strong></label>
<input class="form-control" id="pcodeca1" name="pcodeca1" type="text" size="7" maxlength="7" required="required" data-rule-postalCodeCA="true" />
</div>
<details class="mrgn-bttm-md">
<summary>View code</summary>
<pre><code><div class="wb-frmvld">
<form action="#" method="get" id="validation-example">
...
<div class="form-group">
<label for="pcodeca1" class="required"><span class="field-name">Postal code</span> <strong class="required">(required)</strong></label>
<input class="form-control" id="pcodeca1" name="pcodeca1" type="text" size="7" maxlength="7" required="required" data-rule-postalCodeCA="true" />
</div></code></pre>
</details>
<div class="form-group">
<label for="email1"><span class="field-name">Email address</span> (yourname@domain.com)</label>
<input class="form-control" id="email1" name="email1" type="email" />
</div>
<details class="mrgn-bttm-md">
<summary>View code</summary>
<pre><code><div class="wb-frmvld">
<form action="#" method="get" id="validation-example">
...
<div class="form-group">
<label for="email1"><span class="field-name">Email address</span> (yourname@domain.com)</label>
<input class="form-control" id="email1" name="email1" type="email" />
</div></code></pre>
</details>
<div class="form-group">
<label for="url1"><span class="field-name">Website URL (http://www.url.com)</span></label>
<input class="form-control" id="url1" name="url1" type="url" />
</div>
<details class="mrgn-bttm-md">
<summary>View code</summary>
<pre><code><div class="wb-frmvld">
<form action="#" method="get" id="validation-example">
...
<div class="form-group">
<label for="url1"><span class="field-name">Website URL (http://www.url.com)</span></label>
<input class="form-control" id="url1" name="url1" type="url" />
</div></code></pre>
</details>
<div class="form-group">
<label for="file1" class="required"><span class="field-name">File</span> <strong class="required">(required)</strong></label>
<input id="file1" name="file1" type="file" required="required" />
</div>
<details class="mrgn-bttm-md">
<summary>View code</summary>
<pre><code><div class="wb-frmvld">
<form action="#" method="get" id="validation-example">
...
<div class="form-group">
<label for="file1" class="required"><span class="field-name">File</span> <strong class="required">(required)</strong></label>
<input id="file1" name="file1" type="file" required="required" />
</div></code></pre>
</details>
</fieldset>
<fieldset>
<legend>Other examples</legend>
<div class="form-group">
<label for="date1"><span class="field-name">Date</span><span class="datepicker-format"> (YYYY-MM-DD)</span></label>
<input class="form-control" id="date1" name="date1" type="date" data-rule-dateISO="true" />
</div>
<details class="mrgn-bttm-md">
<summary>View code</summary>
<pre><code><div class="wb-frmvld">
<form action="#" method="get" id="validation-example">
...
<div class="form-group">
<label for="date1"><span class="field-name">Date</span><span class="datepicker-format"> (YYYY-MM-DD)</span></label>
<input class="form-control" id="date1" name="date1" type="date" data-rule-dateISO="true" />
</div></code></pre>
</details>
<div class="form-group">
<label for="time1"><span class="field-name">Time</span> (hh:mm)</label>
<input class="form-control" id="time1" name="time1" type="time" />
</div>
<details class="mrgn-bttm-md">
<summary>View code</summary>
<pre><code><div class="wb-frmvld">
<form action="#" method="get" id="validation-example">
...
<div class="form-group">
<label for="time1"><span class="field-name">Time</span> (hh:mm)</label>
<input class="form-control" id="time1" name="time1" type="time" />
</div></code></pre>
</details>
<div class="form-group">
<label for="number1"><span class="field-name">Number</span> (between 5 and 40)</label>
<input class="form-control" id="number1" name="number1" type="number" min="5" max="40" />
</div>
<details class="mrgn-bttm-md">
<summary>View code</summary>
<pre><code><div class="wb-frmvld">
<form action="#" method="get" id="validation-example">
...
<div class="form-group">
<label for="number1"><span class="field-name">Number</span> (between 5 and 40)</label>
<input class="form-control" id="number1" name="number1" type="number" min="5" max="40" />
</div></code></pre>
</details>
<div class="form-group">
<label for="an1"><span class="field-name">Alphanumeric</span> (at least 4 characters)</label>
<input class="form-control" id="an1" name="an1" type="text" pattern="[A-Za-z0-9\s]{4,}" data-rule-alphanumeric="true" data-rule-minlength="4" />
</div>
<details class="mrgn-bttm-md">
<summary>View code</summary>
<pre><code><div class="wb-frmvld">
<form action="#" method="get" id="validation-example">
...
<div class="form-group">
<label for="an1"><span class="field-name">Alphanumeric</span> (at least 4 characters)</label>
<input class="form-control" id="an1" name="an1" type="text" pattern="[A-Za-z0-9\s]{4,}" data-rule-alphanumeric="true" data-rule-minlength="4" />
</div></code></pre>
</details>
<div class="form-group">
<label for="numeric1"><span class="field-name">Numeric</span> (digits only)</label>
<input class="form-control" id="numeric1" name="numeric1" type="number" data-rule-digits="true" />
</div>
<details class="mrgn-bttm-md">
<summary>View code</summary>
<pre><code><div class="wb-frmvld">
<form action="#" method="get" id="validation-example">
...
<div class="form-group">
<label for="numeric1"><span class="field-name">Numeric</span> (digits only)</label>
<input class="form-control" id="numeric1" name="numeric1" type="number" data-rule-digits="true" />
</div></code></pre>
</details>
<div class="form-group">
<label for="letters1"><span class="field-name">Letters only</span> (maximum of 5 characters)</label>
<input class="form-control" id="letters1" name="letters1" type="text" size="5" maxlength="5" pattern="[A-Za-z\s]" data-rule-lettersonly="true" />
</div>
<details class="mrgn-bttm-md">
<summary>View code</summary>
<pre><code><div class="wb-frmvld">
<form action="#" method="get" id="validation-example">
...
<div class="form-group">
<label for="letters1"><span class="field-name">Letters only</span> (maximum of 5 characters)</label>
<input class="form-control" id="letters1" name="letters1" type="text" size="5" maxlength="5" pattern="[A-Za-z\s]" data-rule-lettersonly="true" />
</div></code></pre>
</details>
<div class="form-group">
<label for="text1"><span class="field-name">Letters and punctuation only</span> (allowed punctuation: [. , ( ) "])</label>
<input class="form-control" id="text1" name="text1" type="text" pattern="[A-Za-z-.,()'"\s]" data-rule-letterswithbasicpunc="true" />
</div>
<details class="mrgn-bttm-md">
<summary>View code</summary>
<pre><code><div class="wb-frmvld">
<form action="#" method="get" id="validation-example">
...
<div class="form-group">
<label for="text1"><span class="field-name">Letters and punctuation only</span> (allowed punctuation: [. , ( ) "])</label>
<input class="form-control" id="text1" name="text1" type="text" pattern="[A-Za-z-.,()'"\s]" data-rule-letterswithbasicpunc="true" />
</div></code></pre>
</details>
<div class="form-group">
<label for="word1"><span class="field-name">Maximum of 10 words</span></label>
<input class="form-control" id="word1" name="word1" type="text" data-rule-maxWords="10" />
</div>
<details class="mrgn-bttm-md">
<summary>View code</summary>
<pre><code><div class="wb-frmvld">
<form action="#" method="get" id="validation-example">
...
<div class="form-group">
<label for="word1"><span class="field-name">Maximum of 10 words</span></label>
<input class="form-control" id="word1" name="word1" type="text" data-rule-maxWords="10" />
</div></code></pre>
</details>
<div class="form-group">
<label for="word2"><span class="field-name">Maximum of 2 words</span></label>
<input class="form-control" id="word2" name="word2" type="text" data-rule-minWords="2" />
</div>
<details class="mrgn-bttm-md">
<summary>View code</summary>
<pre><code><div class="wb-frmvld">
<form action="#" method="get" id="validation-example">
...
<div class="form-group">
<label for="word2"><span class="field-name">Minimum of 2 words</span></label>
<input class="form-control" id="word2" name="word2" type="text" data-rule-minWords="2" />
</div></code></pre>
</details>
<div class="form-group">
<label for="word3"><span class="field-name">Between 2 and 10 words</span></label>
<input class="form-control" id="word3" name="word3" type="text" data-rule-rangeWords="[2,10]" />
</div>
<details class="mrgn-bttm-md">
<summary>View code</summary>
<pre><code><div class="wb-frmvld">
<form action="#" method="get" id="validation-example">
...
<div class="form-group">
<label for="word3"><span class="field-name">Between 2 and 10 words</span></label>
<input class="form-control" id="word3" name="word3" type="text" data-rule-rangeWords="[2,10]" />
</div></code></pre>
</details>
<div class="form-group">
<label for="nowhitespace1"><span class="field-name">No white space</span></label>
<input class="form-control" id="nowhitespace1" name="nowhitespace1" type="text" data-rule-nowhitespace="true" />
</div>
<details class="mrgn-bttm-md">
<summary>View code</summary>
<pre><code><div class="wb-frmvld">
<form action="#" method="get" id="validation-example">
...
<div class="form-group">
<label for="nowhitespace1"><span class="field-name">No white space</span></label>
<input class="form-control" id="nowhitespace1" name="nowhitespace1" type="text" pattern="[A-Za-z-.,()'"\s]" data-rule-nowhitespace="true" />
</div></code></pre>
</details>
<div class="form-group">
<label for="password1"><span class="field-name">Password</span> (between 5 and 10 characters)</label>
<input class="form-control" id="password1" name="password1" type="password" maxlength="10" size="10" pattern=".{5,10}" data-rule-rangelength="[5,10]" />
<label for="passwordconfirm"><span class="field-name">Confirm your password</span></label>
<input class="form-control" id="passwordconfirm" name="passwordconfirm" type="password" maxlength="10" size="10" data-rule-equalTo="#password1" />
</div>
<details class="mrgn-bttm-md">
<summary>View code</summary>
<pre><code><div class="wb-frmvld">
<form action="#" method="get" id="validation-example">
...
<div class="form-group">
<label for="password1"><span class="field-name">Password</span> (between 5 and 10 characters)</label>
<input class="form-control" id="password1" name="password1" type="password" maxlength="10" size="10" pattern=".{5,10}" data-rule-rangelength="[5,10]" />
<label for="passwordconfirm"><span class="field-name">Confirm your password</span></label>
<input class="form-control" id="passwordconfirm" name="passwordconfirm" type="password" maxlength="10" size="10" data-rule-equalTo="#password1" />
</div></code></pre>
</details>
</fieldset>
<fieldset>
<legend class="required"><span class="field-name">Favourite pets</span> <strong class="required">(required)</strong></legend>
<div class="checkbox">
<label for="animal1"><input type="checkbox" name="animal" value="1" id="animal1" required="required" />  Dog</label>
</div>
<div class="checkbox">
<label for="animal2"><input type="checkbox" name="animal" value="2" id="animal2" />  Cat</label>
</div>
<div class="checkbox">
<label for="animal3"><input type="checkbox" name="animal" value="3" id="animal3" />  Fish</label>
</div>
<div class="checkbox">
<label for="animal4"><input type="checkbox" name="animal" value="4" id="animal4" />  Other</label>
</div>
</fieldset>
<details class="mrgn-bttm-md">
<summary>View code</summary>
<pre><code><div class="wb-frmvld">
<form action="#" method="get" id="validation-example">
...
<fieldset>
<legend class="required"><span class="field-name">Favourite pets</span> <strong class="required">(required)</strong></legend>
<div class="checkbox">
<label for="animal1"><input type="checkbox" name="animal" value="1" id="animal1" required="required" />&#160;&#160;Dog</label>
</div>
<div class="checkbox">
<label for="animal2"><input type="checkbox" name="animal" value="2" id="animal2" />&#160;&#160;Cat</label>
</div>
<div class="checkbox">
<label for="animal3"><input type="checkbox" name="animal" value="3" id="animal3" />&#160;&#160;Fish</label>
</div>
<div class="checkbox">
<label for="animal4"><input type="checkbox" name="animal" value="4" id="animal4" />&#160;&#160;Other</label>
</div>
</fieldset></code></pre>
</details>
<fieldset>
<legend class="required"><span class="field-name">Citizenship status</span> <strong class="required">(required)</strong></legend>
<div class="radio">
<label for="status1"><input type="radio" name="status" value="1" id="status1" required="required" />  Canadian citizen</label>
</div>
<div class="radio">
<label for="status2"><input type="radio" name="status" value="2" id="status2" />  Permanent resident</label>
</div>
<div class="radio">
<label for="status3"><input type="radio" name="status" value="3" id="status3" />  Work permit</label>
</div>
<div class="radio">
<label for="status4"><input type="radio" name="status" value="4" id="status4" />  Other</label>
</div>
</fieldset>
<details class="mrgn-bttm-md">
<summary>View code</summary>
<pre><code><div class="wb-frmvld">
<form action="#" method="get" id="validation-example">
...
<fieldset>
<legend class="required"><span class="field-name">Citizenship status</span> <strong class="required">(required)</strong></legend>
<div class="radio">
<label for="status1"><input type="radio" name="status" value="1" id="status1" required="required" />&#160;&#160;Canadian citizen</label>
</div>
<div class="radio">
<label for="status2"><input type="radio" name="status" value="2" id="status2" />&#160;&#160;Permanent resident</label>
</div>
<div class="radio">
<label for="status3"><input type="radio" name="status" value="3" id="status3" />&#160;&#160;Work permit</label>
</div>
<div class="radio">
<label for="status4"><input type="radio" name="status" value="4" id="status4" />&#160;&#160;Other</label>
</div>
</fieldset></code></pre>
</details>
<input type="submit" value="Submit" class="btn btn-primary" /> <input type="reset" value="Reset" class="btn btn-default" />
</form>
</div>
<noscript>
<p>This form cannot be submitted without JavaScript. You may use one of the following methods:</p>
<ul>
<li>Method 1</li>
<li>Method 2</li>
<li>Method n</li>
</ul>
</noscript>
</section>