Skip to content

Commit

Permalink
Update validator.js
Browse files Browse the repository at this point in the history
validator.passes().form.submit();

针对个别form,需要验证,同时也可以跳当前验证直接进入下一步,情况下使用
  • Loading branch information
dulumao authored and jaywcjlove committed Sep 12, 2017
1 parent a47253b commit c1fa49a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/validator.js
Expand Up @@ -125,6 +125,8 @@ Validator.prototype = {
* @return {[type]} [JSON]
*/
validate:function(evt){
// 特殊情况直接通过
if (this._passes) return this;

this.handles["ok"] = true;
this.handles["evt"] = evt;
Expand Down Expand Up @@ -164,6 +166,10 @@ Validator.prototype = {

return this;
},
passes: function () {
this._passes = true;
return this;
},
_validateField:function(field){

var rules = field.rules.split('|'),
Expand Down

0 comments on commit c1fa49a

Please sign in to comment.