Skip to content

Instantly share code, notes, and snippets.

@wonderbeyond
Last active August 29, 2015 14:07
Show Gist options
  • Select an option

  • Save wonderbeyond/4026ff458e2430f7fc27 to your computer and use it in GitHub Desktop.

Select an option

Save wonderbeyond/4026ff458e2430f7fc27 to your computer and use it in GitHub Desktop.
arale/validator addRule for integer check
MyValidator.addRule('integer', function(options){
var v = Number(options.element.val());
if(v && Math.floor(v) === v){
return true;
}
return false;
}, '{{display}}必须为整数');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment