Browse Source

Add Canadian Postal Code support

Adds support for canadian postal codes
Francis Morissette 11 years ago
parent
commit
93fa5a3e3c
1 changed files with 2 additions and 0 deletions
  1. 2 0
      src/js/validator/zipCode.js

+ 2 - 0
src/js/validator/zipCode.js

@@ -28,6 +28,8 @@
 
             options.country = options.country || 'US';
             switch (options.country.toUpperCase()) {
+                case 'CA':
+                    return /(?:A|B|C|E|G|J|K|L|M|N|P|R|S|T|V|X|Y){1}[0-9]{1}(?:A|B|C|E|G|J|K|L|M|N|P|R|S|T|V|X|Y){1}\s?[0-9]{1}(?:A|B|C|E|G|J|K|L|M|N|P|R|S|T|V|X|Y){1}[0-9]{1}/i.test(value);
                 case 'DK':
                     return /^(DK(-|\s)?)?\d{4}$/i.test(value);
                 case 'SE':