Skip to content

Commit

Permalink
modfiy demo for validator.js
Browse files Browse the repository at this point in the history
  • Loading branch information
zkeyword committed Oct 19, 2015
1 parent 47ac6bc commit 8532c51
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions dest/js/app/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2925,7 +2925,6 @@ define('core/validator',['core/saogaUI'], function(saogaUI){
fUnAction( oItem.eq(i) );
}
}

return g.getStatus();
};

Expand Down Expand Up @@ -3012,7 +3011,7 @@ define('core/validator',['core/saogaUI'], function(saogaUI){
$('html, body').animate({scrollTop:nErrorOffsetTop}, 500);
//oVisibleError.focus();
}

return !len;
};

Expand Down
5 changes: 3 additions & 2 deletions dev/demo/validator.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@
<span class="ui-form-message"></span>
</label>
</div>
<div class="fn-clear ui-mt10">
<div class="ui-form fn-clear ui-mt10">
<label>
<i class="ui-label ui-w400">必填(required):</i>
<input class="ui-input" type="text" data-validate="required;number;floatNumber=2" data-validate-requiredText="xxx,必填" />
<span class="ui-form-message"></span>
</label>
</div>
<div class="ui-form fn-clear ui-mt10">
Expand Down Expand Up @@ -281,7 +282,7 @@
}
});

$('input[type="submit"]').click(function(){
$('input[type="submit"]').on('submit', function(){
if( validator.getStatus() ){
console.log('验证通过!');
};
Expand Down
3 changes: 1 addition & 2 deletions dev/js/core/validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,6 @@ define(['core/saogaUI'], function(saogaUI){
fUnAction( oItem.eq(i) );
}
}

return g.getStatus();
};

Expand Down Expand Up @@ -683,7 +682,7 @@ define(['core/saogaUI'], function(saogaUI){
$('html, body').animate({scrollTop:nErrorOffsetTop}, 500);
//oVisibleError.focus();
}

return !len;
};

Expand Down

0 comments on commit 8532c51

Please sign in to comment.