Skip to content

Instantly share code, notes, and snippets.

@alexanmtz
Created July 11, 2012 03:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexanmtz/3087709 to your computer and use it in GitHub Desktop.
Save alexanmtz/3087709 to your computer and use it in GitHub Desktop.
Novo método do validate
// Metodo para validar se a pessoa tem mais de 18 anos, ela serve para ilustrar como usar o addMethod para criar qualquer regra de validação
jQuery.validator.addMethod("minAge", function(value, element, params) {
return this.optional(element) || value > params;
}, "Você precisa ter mais de 18 anos.");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment