Skip to content
This repository has been archived by the owner on Jul 1, 2020. It is now read-only.

Commit

Permalink
Fix #3 - Form became invalid
Browse files Browse the repository at this point in the history
I believe this fixes it but could not fully test it as I cannot
reproduce the actual problem
  • Loading branch information
ghiscoding committed Mar 3, 2014
1 parent 33438a5 commit 62ae317
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion angular-validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@
// run the Regex test through each iteration
for(var j = 0, jln = patterns.length; j < jln; j++) {
regex = new RegExp(patterns[j], 'i');
isValid = regex.test(value);
isValid = (patterns[j] === "required" && typeof value === "undefined") ? false : regex.test(value);
if(!isValid) {
isFieldValid = false;
message += $translate(messages[j].message);
Expand Down

0 comments on commit 62ae317

Please sign in to comment.