Skip to content

Commit

Permalink
uk
Browse files Browse the repository at this point in the history
  • Loading branch information
John Antoni Griffiths committed Jun 27, 2011
1 parent b19e8bd commit b66e263
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
11 changes: 0 additions & 11 deletions jquery.validate.filters.js
Expand Up @@ -2,17 +2,6 @@ jQuery.validator.addMethod("accept", function(value, element, param) {
return value.match(new RegExp("^" + 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) { jQuery.validator.addMethod("lettersOnly", function(value, element) {
// Addon method for validating letter-only text boxes. // Addon method for validating letter-only text boxes.
Expand Down
11 changes: 11 additions & 0 deletions jquery.validate.filters.uk.js
@@ -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.