Split out nowhitespace

This commit is contained in:
Nick Schonning
2013-03-22 20:13:24 -04:00
committed by Jörn Zaefferer
parent 8404ade32c
commit be94cfeb41
2 changed files with 3 additions and 4 deletions

View File

@@ -33,10 +33,6 @@
}());
jQuery.validator.addMethod("nowhitespace", function(value, element) {
return this.optional(element) || /^\S+$/i.test(value);
}, "No white space please");
jQuery.validator.addMethod("ziprange", function(value, element) {
return this.optional(element) || /^90[2-5]\d\{2\}-\d{4}$/.test(value);
}, "Your ZIP-code must be in the range 902xx-xxxx to 905-xx-xxxx");

View File

@@ -0,0 +1,3 @@
jQuery.validator.addMethod("nowhitespace", function(value, element) {
return this.optional(element) || /^\S+$/i.test(value);
}, "No white space please");