Skip to content

Commit 7f7d3fc

Browse files
committed
Releasing 1.0.1
Fixed issue when submit.settings.allErrors: true was ignored Fixed JS error when submitting an empty field with a comparison rule Fixed default error message when using "V" comparison rule ex: <code>data-validation="[V>0]"
1 parent a7ae3c8 commit 7f7d3fc

File tree

4 files changed

+28
-29
lines changed

4 files changed

+28
-29
lines changed

html5-form-validation.jquery.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
"validation",
1010
"input"
1111
],
12-
"version": "1.0.0",
12+
"version": "1.0.1",
1313
"author": {
1414
"name": "Tom Bertrand",
15-
"url": "www.runningcoder.org/jqueryvalidation/"
15+
"url": "http://www.runningcoder.org/jqueryvalidation/"
1616
},
1717
"licenses": [
1818
{

jquery.validation-1.0.0.min.js

Lines changed: 0 additions & 16 deletions
This file was deleted.
Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* jQuery Form Validation
33
*
44
* @author Tom Bertrand
5-
* @version 1.0.0 (2014-05-22)
5+
* @version 1.0.1 (2014-05-23)
66
*
77
* @copyright
88
* Copyright (C) 2014 Tom Bertrand.
@@ -67,7 +67,7 @@
6767
'DATE': '$ is not a valid with format YYYY-MM-DD.',
6868
'EMAIL': '$ is not valid.',
6969
'URL': '$ is not valid.',
70-
'PHONE': '$ is not a valid phone number',
70+
'PHONE': '$ is not a valid phone number.',
7171
//'INARRAY': '$ is not a valid option.',
7272
'<': '$ must be less than % characters.',
7373
'<=': '$ must be less or equal to % characters.',
@@ -396,7 +396,7 @@
396396

397397
} catch (error) {
398398

399-
if (validationMessage) {
399+
if (validationMessage || !options.submit.settings.allErrors) {
400400
validateOnce = true;
401401
}
402402

@@ -520,13 +520,13 @@
520520
return false;
521521
}
522522

523-
if (!eval('"' + encodeURIComponent(value) + '"' + operator + '"' + encodeURIComponent(comparedValue) + '"')) {
523+
if (!value || !eval('"' + encodeURIComponent(value) + '"' + operator + '"' + encodeURIComponent(comparedValue) + '"')) {
524524
throw [_message[operator], compared];
525525
}
526526

527527
} else {
528528

529-
if (eval(value.length + operator + parseFloat(compared)) == false) {
529+
if (!value || eval(value.length + operator + parseFloat(compared)) == false) {
530530
throw [_message[operator], compared];
531531
}
532532

@@ -545,14 +545,14 @@
545545
return false;
546546
}
547547

548-
if (!eval('"' + encodeURIComponent(value) + '"' + operator + '"' + encodeURIComponent(comparedValue) + '"')) {
549-
throw [_message[operator], compared];
548+
if (!value || !eval('"' + encodeURIComponent(value) + '"' + operator + '"' + encodeURIComponent(comparedValue) + '"')) {
549+
throw [_message[operator].replace(' characters', ''), compared];
550550
}
551551

552552
} else {
553553

554-
if (!eval(value + operator + parseFloat(compared))) {
555-
throw [_message[operator], compared];
554+
if (!value || !eval(value + operator + parseFloat(compared))) {
555+
throw [_message[operator].replace(' characters', ''), compared];
556556
}
557557

558558
}
@@ -734,11 +734,10 @@
734734
(group ? label : input).parentsUntil(node, options.submit.settings.inputContainer).removeClass(options.submit.settings.errorClass)
735735
}
736736

737-
label.removeClass(options.submit.settings.errorClass);
737+
label && label.removeClass(options.submit.settings.errorClass);
738738

739739
input.removeClass(options.submit.settings.errorClass);
740740

741-
742741
if (options.submit.settings.display === 'inline') {
743742
container.find('[' + _data.errorList + ']').remove();
744743
}

0 commit comments

Comments
 (0)