Skip to content

Commit

Permalink
Merge pull request victorjonsson#48 from seryl/support_null_validation
Browse files Browse the repository at this point in the history
Support null validation (Remove validation)
  • Loading branch information
victorjonsson committed Sep 1, 2013
2 parents 3597fce + 69b2ef1 commit ab82b49
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion form-validator/jquery.form-validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,12 @@
.addClass('valid')
.parent()
.addClass('has-success'); // twitter bs
} else if(validation === null) {
$element
.removeClass('valid')
.parent()
.removeClass('has-error')
.removeClass('has-success');
} else {
$element
.addClass(config.errorElementClass)
Expand Down Expand Up @@ -698,7 +704,7 @@
// if empty AND optional attribute is present
// OR depending on a checkbox being checked AND checkbox is checked, return true
if ((!value && optional === 'true') || (validationDependsOnCheckedInput && !validationDependentInputIsChecked)) {
return true;
return null;
}

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

0 comments on commit ab82b49

Please sign in to comment.