Skip to content

Commit 69b2ef1

Browse files
committed
Support null validation (Remove validation)
1 parent 3597fce commit 69b2ef1

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

form-validator/jquery.form-validator.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,12 @@
126126
.addClass('valid')
127127
.parent()
128128
.addClass('has-success'); // twitter bs
129+
} else if(validation === null) {
130+
$element
131+
.removeClass('valid')
132+
.parent()
133+
.removeClass('has-error')
134+
.removeClass('has-success');
129135
} else {
130136
$element
131137
.addClass(config.errorElementClass)
@@ -698,7 +704,7 @@
698704
// if empty AND optional attribute is present
699705
// OR depending on a checkbox being checked AND checkbox is checked, return true
700706
if ((!value && optional === 'true') || (validationDependsOnCheckedInput && !validationDependentInputIsChecked)) {
701-
return true;
707+
return null;
702708
}
703709

704710
var validationRules = $element.attr(config.validationRuleAttribute),

0 commit comments

Comments
 (0)