浏览代码

Merge pull request #711 from talberti/patch-1

Keep disabled validators VAILD
Phuoc Nguyen 11 年之前
父节点
当前提交
7d53504abd
共有 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);