浏览代码

Keep disabled valadtiors VAILD

For each validator that has been disabled, update the status to STATUS_VALID. This fixes Validating icon when some validators are disabled #687 that @yamifr07  reported.
Tony 11 年之前
父节点
当前提交
a356718237
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      src/js/bootstrapValidator.js

+ 4 - 1
src/js/bootstrapValidator.js

@@ -774,9 +774,12 @@
 
                     // Don't validate field if it is already done
                     var result = $field.data('bv.result.' + validatorName);
-                    if (result === this.STATUS_VALID || result === this.STATUS_INVALID || validators[validatorName].enabled === false) {
+                    if (result === this.STATUS_VALID || result === this.STATUS_INVALID) {
                         this._onFieldValidated($field, validatorName);
                         continue;
+                    }else if (validators[validatorName].enabled === false) {
+                        this.updateStatus(updateAll ? field : $field, this.STATUS_VALID, validatorName);
+                        continue;                        
                     }
 
                     $field.data('bv.result.' + validatorName, this.STATUS_VALIDATING);