From dcef3ac80ccb59310e7494a1187a521e885ea1e0 Mon Sep 17 00:00:00 2001 From: jaywcjlove <398188662@qq.com> Date: Thu, 27 Apr 2017 16:02:26 +0800 Subject: [PATCH] Fix bad inure. #7 --- src/validator.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/validator.js b/src/validator.js index 973d02d..bbfbb7c 100644 --- a/src/validator.js +++ b/src/validator.js @@ -81,7 +81,6 @@ var Validator = function(formelm, fields, callback){ // 将验证方法绑到 Validator 对象上去 for (var a in _testHook) this[camelCase(a)] = _testHook[a]; - this.isCallback = callback?true:false; this.callback = callback || function(){}; this.form = _formElm(formelm) || {}; this.errors = []; @@ -188,7 +187,7 @@ Validator.prototype = { return field.display.split('|')[i] && field.display.split('|')[i].replace('{{'+field.name+'}}',field.value) })() - var existingError; + var existingError,j; for (j = 0; j < this.errors.length; j += 1) { if (field.element === this.errors[j].element) { existingError = this.errors[j];