Created
January 27, 2014 19:08
-
-
Save davidalencar/8655347 to your computer and use it in GitHub Desktop.
validate_ptbr
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery.extend(jQuery.validator.methods, { | |
date: function (value, element) { | |
return this.optional(element) || /^\d\d?\/\d\d?\/\d\d\d?\d?$/.test(value); | |
}, | |
number: function (value, element) { | |
return this.optional(element) || /^-?(?:\d+|\d{1,3}(?:\.\d{3})+)(?:,\d+)?$/.test(value); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment