Skip to content

Commit 8c06744

Browse files
committed
Merge pull request #637 from hackle/patch-1
equals should be validated even empty
2 parents 3830218 + 0616bcc commit 8c06744

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)