Permalink
Browse files

uk

  • Loading branch information...
1 parent b19e8bd commit b66e263370586b49c2d615c49244687be61e05d4 @johnantoni committed Jun 27, 2011
Showing with 11 additions and 11 deletions.
  1. +0 −11 jquery.validate.filters.js
  2. +11 −0 jquery.validate.filters.uk.js
View
@@ -2,17 +2,6 @@ jQuery.validator.addMethod("accept", function(value, element, param) {
return value.match(new RegExp("^" + param + "$"));
});
-jQuery.validator.addMethod('phoneUK', function(phone_number, element) {
- return this.optional(element) || phone_number.length > 9 &&
- phone_number.match(/^(\(?(0|\+44)[1-9]{1}\d{1,4}?\)?\s?\d{3,4}\s?\d{3,4})$/);
- }, 'Please specify a valid phone number'
-);
-
-jQuery.validator.addMethod('mobileUK', function(phone_number, element) {
- return this.optional(element) || phone_number.length > 9 &&
- phone_number.match(/^((0|\+44)7(5|6|7|8|9){1}\d{2}\s?\d{6})$/);
- }, 'Please specify a valid mobile number'
-);
jQuery.validator.addMethod("lettersOnly", function(value, element) {
// Addon method for validating letter-only text boxes.
@@ -0,0 +1,11 @@
+jQuery.validator.addMethod('phoneUK', function(phone_number, element) {
+ return this.optional(element) || phone_number.length > 9 &&
+ phone_number.match(/^(\(?(0|\+44)[1-9]{1}\d{1,4}?\)?\s?\d{3,4}\s?\d{3,4})$/);
+ }, 'Please specify a valid phone number'
+);
+
+jQuery.validator.addMethod('mobileUK', function(phone_number, element) {
+ return this.optional(element) || phone_number.length > 9 &&
+ phone_number.match(/^((0|\+44)7(5|6|7|8|9){1}\d{2}\s?\d{6})$/);
+ }, 'Please specify a valid mobile number'
+);

0 comments on commit b66e263

Please sign in to comment.