Skip to content

Commit

Permalink
出错的时候增加log,方便调试
Browse files Browse the repository at this point in the history
  • Loading branch information
jianping.xwh committed Nov 20, 2013
1 parent 4f0be46 commit 6c7ee29
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions 1.5/demo/simple_form.html
Expand Up @@ -77,11 +77,11 @@ <h2>一个简单表单的验证</h2>
debug: true
});
if (S.Config.debug) {
var srcPath = "../../../";
var srcPath = "../../";
S.config({
packages:[
{
name: "gallery",
name: "gallery/auth",
path: srcPath,
charset: "utf-8",
ignorePackageNameInUri: true
Expand Down
1 change: 1 addition & 0 deletions 1.5/lib/field/field.js
Expand Up @@ -307,6 +307,7 @@ KISSY.add(function (S, Event, Base, DOM,Node,Promise, Factory, Rule, Msg, Utils)
}).fail(function(rule){
//有规则存在验证失败
_defer.reject(rule);
S.log(self.get('name')+'字段出错的规则是:'+rule.get('name'));
self.fire('error',{rule:rule});
});
return PROMISE;
Expand Down
2 changes: 1 addition & 1 deletion 1.5/lib/rule/default.js
Expand Up @@ -74,7 +74,7 @@ KISSY.add(function (S) {
$target.each(function($el){
if($el.prop('checked')) value ++;
})
if(!this.msg('error')) this.msg('error','最小必须选择'+attr+'项');
if(!this.msg('error')) this.msg('error','至少选择'+attr+'项');
}
return Number(value) > Number(attr);
},
Expand Down

0 comments on commit 6c7ee29

Please sign in to comment.