Skip to content

Commit 9c21665

Browse files
committed
added unit tests for swe mobile, added checkbox_group validation to test.html
1 parent 7ca10b1 commit 9c21665

File tree

10 files changed

+69
-11
lines changed

10 files changed

+69
-11
lines changed

form-validator/date.dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
* @website http://formvalidator.net/#location-validators
1212
* @license Dual licensed under the MIT or GPL Version 2 licenses
13-
* @version 2.0.12
13+
* @version 2.0.14
1414
*/
1515
(function($) {
1616

form-validator/file.dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
* @website http://formvalidator.net/
1212
* @license Dual licensed under the MIT or GPL Version 2 licenses
13-
* @version 2.0.12
13+
* @version 2.0.14
1414
*/
1515
(function($, window) {
1616

form-validator/jquery.form-validator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* @website http://formvalidator.net/
77
* @license Dual licensed under the MIT or GPL Version 2 licenses
8-
* @version 2.0.12
8+
* @version 2.0.14
99
*/
1010
(function($) {
1111

form-validator/jquery.form-validator.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

form-validator/location.dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
* @website http://formvalidator.net/#location-validators
1212
* @license Dual licensed under the MIT or GPL Version 2 licenses
13-
* @version 2.0.12
13+
* @version 2.0.14
1414
*/
1515
(function($) {
1616

form-validator/security.dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*
1313
* @website http://formvalidator.net/#security-validators
1414
* @license Dual licensed under the MIT or GPL Version 2 licenses
15-
* @version 2.0.12
15+
* @version 2.0.14
1616
*/
1717
(function($) {
1818

form-validator/sweden.dev.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*
1414
* @website http://formvalidator.net/#swedish-validators
1515
* @license Dual licensed under the MIT or GPL Version 2 licenses
16-
* @version 2.0.12
16+
* @version 2.0.14
1717
*/
1818
(function($, window) {
1919

@@ -177,7 +177,7 @@
177177
} else if (number.length != 11 && begin === '467') {
178178
return false;
179179
}
180-
return (/07[0-9{1}]/).test(begin) || (begin === '467' && number.substr(3, 1) === '0');
180+
return (/07[0-9{1}]/).test(begin) || begin === '467';
181181
},
182182
errorMessage : '',
183183
errorMessageKey: 'badTelephone'

form-validator/sweden.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

form-validator/test.html

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@
66
<link rel="stylesheet" href="http://code.jquery.com/qunit/qunit-1.12.0.css">
77
<style>
88
.form-error {
9-
color: darkred;
9+
color: red;
10+
display: block;
11+
}
12+
label {
13+
margin-left: 5px;
1014
}
1115
</style>
1216
</head>
@@ -62,6 +66,35 @@
6266
validation will fail<br />
6367
<input id="callback" />
6468
</p>
69+
<p>
70+
<strong>Checkbox group</strong><br />
71+
<label>
72+
<input type="checkbox" name="box" value="1"
73+
data-validation="checkbox_group"
74+
data-validation-qty="1-2" />
75+
1
76+
</label>
77+
<label>
78+
<input type="checkbox" name="box" value="2" />
79+
2
80+
</label>
81+
<label>
82+
<input type="checkbox" name="box" value="3" />
83+
3
84+
</label>
85+
<label>
86+
<input type="checkbox" name="box" value="4" />
87+
4
88+
</label>
89+
<label>
90+
<input type="checkbox" name="box" value="5" />
91+
5
92+
</label>
93+
<label>
94+
<input type="checkbox" name="box" value="6" />
95+
6
96+
</label>
97+
</p>
6598
<p>
6699
<input type="submit">
67100
</p>
@@ -353,6 +386,31 @@
353386
});
354387
});
355388

389+
390+
/*
391+
* SWEDISH MOBILE VALIDATION
392+
*/
393+
test("Swe mobile validation", function() {
394+
395+
clearForm();
396+
397+
var links = [
398+
{val:'0702777118', isValid:true},
399+
{val:'0722777118', isValid:true},
400+
{val:'46702777118', isValid:true},
401+
{val:'45702777118', isValid:false},
402+
{val:'+46702777118', isValid:true},
403+
{val:'+45702777118', isValid:false},
404+
{val:'0732777118', isValid:true},
405+
{val:'0302777118', isValid:false},
406+
{val:'07027771', isValid:false}
407+
];
408+
409+
$.each(links, function(i, obj) {
410+
runTest(obj, 'swemobile');
411+
});
412+
});
413+
356414
/*
357415
* LENGTH VALIDATION
358416
*/

form-validator/uk.dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
* @website http://formvalidator.net/#uk-validators
1111
* @license Dual licensed under the MIT or GPL Version 2 licenses
12-
* @version 2.0.12
12+
* @version 2.0.14
1313
*/
1414
$.formUtils.addValidator({
1515
name : 'ukvatnumber',

0 commit comments

Comments
 (0)