Permalink
Browse files

Changed Postcode to accept entries with no spaces

  • Loading branch information...
1 parent 318df7e commit 7ba34084012f8080ab42846fa7fe9a22bb30494d @simonpioli committed May 3, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 additional-methods.js
@@ -235,7 +235,7 @@ jQuery.validator.addMethod('phonesUK', function(phone_number, element) {
jQuery.validator.addMethod('postcodeUK', function(postcode, element) {
postcode = (postcode.toUpperCase());
return this.optional(element) || postcode.length >= 5 &&
-postcode.match(/[A-Z]{1,2}[0-9R][0-9A-Z]? [0-9][ABD-HJLNP-UW-Z]{2}/) || postcode.match(/^(GIR)(0AA)$/) || postcode.match(/^(BFPO)([0-9]{1,4})$/) || postcode.match(/^(BFPO)(C\/O[0-9]{1,3})$/;
+postcode.match(/[A-Z]{1,2}[0-9R][0-9A-Z]?[ ]?[0-9][ABD-HJLNP-UW-Z]{2}/) || postcode.match(/^(GIR)(0AA)$/) || postcode.match(/^(BFPO)([0-9]{1,4})$/) || postcode.match(/^(BFPO)(C\/O[0-9]{1,3})$/;
}, 'Please specify a valid postcode.');

0 comments on commit 7ba3408

Please sign in to comment.