Created
May 13, 2011 10:13
-
-
Save thiamteck/970297 to your computer and use it in GitHub Desktop.
JQuery validator method for checking integer that not start with zero
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.validator.addMethod("numberNotStartWithZero", function(value, element) { | |
| return this.optional(element) || /^[1-9][0-9]+$/i.test(value); | |
| }, "Please enter a valid number. (Do not start with zero)"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment