mirror of
https://github.com/jquery-validation/jquery-validation.git
synced 2025-12-20 09:11:40 +01:00
Split out nowhitespace
This commit is contained in:
committed by
Jörn Zaefferer
parent
8404ade32c
commit
be94cfeb41
@@ -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");
|
||||
|
||||
3
src/additional/nowhitespace.js
Normal file
3
src/additional/nowhitespace.js
Normal file
@@ -0,0 +1,3 @@
|
||||
jQuery.validator.addMethod("nowhitespace", function(value, element) {
|
||||
return this.optional(element) || /^\S+$/i.test(value);
|
||||
}, "No white space please");
|
||||
Reference in New Issue
Block a user