Browse Source

Update zipCode.js

Adrian Vacaru 11 years ago
parent
commit
9f46098e8d
1 changed files with 6 additions and 1 deletions
  1. 6 1
      src/js/validator/zipCode.js

+ 6 - 1
src/js/validator/zipCode.js

@@ -11,6 +11,7 @@
             IT: 'Italian postal code',
             MA: 'Moroccan postal code',
             NL: 'Dutch postal code',
+            RO: 'Romania Post Code',
             SE: 'Swiss postal code',
             SG: 'Singapore postal code',
             US: 'US zip code'
@@ -23,7 +24,7 @@
             country: 'country'
         },
 
-        COUNTRY_CODES: ['BR', 'CA', 'DK', 'GB', 'IT', 'MA', 'NL', 'SE', 'SG', 'US'],
+        COUNTRY_CODES: ['BR', 'CA', 'DK', 'GB', 'IT', 'MA', 'NL', 'RO', 'SE', 'SG', 'US'],
 
         /**
          * Return true if and only if the input value is a valid country zip code
@@ -97,6 +98,10 @@
                 case 'NL':
                     isValid = /^[1-9][0-9]{3} ?(?!sa|sd|ss)[a-z]{2}$/i.test(value);
                     break;
+                    
+                case 'RO':
+                    isValid = /^(0[1-8]{1}|[1-9]{1}[0-5]{1})?[0-9]{4}$/i.test(value);
+                    break;
 
                 case 'SE':
                     isValid = /^(S-)?\d{3}\s?\d{2}$/i.test(value);