Skip to content

Commit a8d1d15

Browse files
committed
修复required:false的结果处理问题
1 parent 731c5fb commit a8d1d15

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

jquery-validator-1.3.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@
280280
}
281281
}
282282
if( !value ){
283-
if( expr ){
283+
if( expr && (!$.isFunction(expr) || (expr = expr.call(this, value, context)))){
284284
this.sendError(basedLength ? "checked":"", value, "required", context);
285285
return false;
286286
}
@@ -549,7 +549,7 @@
549549
if( me.validator.required.call(me, value, rule.required, context) === false){
550550
return me.afterHandler(false, context);
551551
}
552-
if( context._stop ) return me.afterHandler(false, context);
552+
if( context._stop ) return me.afterHandler(true, context);
553553
delete rule.required;
554554
}
555555
// 如果设置了格式验证

0 commit comments

Comments
 (0)