Skip to content

Commit 0616bcc

Browse files
committed
equals should be validated even empty
//the 3rd condition is added so that even empty password fields should be equal //otherwise if one is filled and another left empty, the "equal" condition would fail //which does not make any sense
1 parent 99ea7d3 commit 0616bcc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

js/jquery.validationEngine.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,10 @@
704704
}
705705
}
706706
// If the rules required is not added, an empty field is not validated
707-
if(!required && !(field.val()) && field.val().length < 1) options.isError = false;
707+
//the 3rd condition is added so that even empty password fields should be equal
708+
//otherwise if one is filled and another left empty, the "equal" condition would fail
709+
//which does not make any sense
710+
if(!required && !(field.val()) && field.val().length < 1 && rules.indexOf("equals") < 0) options.isError = false;
708711

709712
// Hack for radio/checkbox group button, the validation go into the
710713
// first radio/checkbox of the group

0 commit comments

Comments
 (0)