Skip to content

Commit 62ae317

Browse files
committed
Fix ghiscoding#3 - Form became invalid
I believe this fixes it but could not fully test it as I cannot reproduce the actual problem
1 parent 33438a5 commit 62ae317

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

angular-validation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@
256256
// run the Regex test through each iteration
257257
for(var j = 0, jln = patterns.length; j < jln; j++) {
258258
regex = new RegExp(patterns[j], 'i');
259-
isValid = regex.test(value);
259+
isValid = (patterns[j] === "required" && typeof value === "undefined") ? false : regex.test(value);
260260
if(!isValid) {
261261
isFieldValid = false;
262262
message += $translate(messages[j].message);

0 commit comments

Comments
 (0)