|
|
@@ -9,6 +9,7 @@
|
|
|
FR: 'France',
|
|
|
GB: 'United Kingdom',
|
|
|
MA: 'Morocco',
|
|
|
+ PK: 'Pakistan',
|
|
|
US: 'USA'
|
|
|
}
|
|
|
});
|
|
|
@@ -20,7 +21,7 @@
|
|
|
},
|
|
|
|
|
|
// The supported countries
|
|
|
- COUNTRY_CODES: ['BR', 'ES', 'FR', 'GB', 'MA', 'US'],
|
|
|
+ COUNTRY_CODES: ['BR', 'ES', 'FR', 'GB', 'MA', 'PK', 'US'],
|
|
|
|
|
|
/**
|
|
|
* Return true if the input value contains a valid phone number for the country
|
|
|
@@ -91,6 +92,12 @@
|
|
|
isValid = (/^(?:(?:(?:\+|00)212[\s]?(?:[\s]?\(0\)[\s]?)?)|0){1}(?:5[\s.-]?[2-3]|6[\s.-]?[13-9]){1}[0-9]{1}(?:[\s.-]?\d{2}){3}$/).test(value);
|
|
|
break;
|
|
|
|
|
|
+ case 'PK':
|
|
|
+ // http://regex101.com/r/yH8aV9/2
|
|
|
+ value = $.trim(value);
|
|
|
+ isValid = (/^0?3[0-9]{2}[0-9]{7}$/).test(value);
|
|
|
+ break;
|
|
|
+
|
|
|
case 'US':
|
|
|
/* falls through */
|
|
|
default:
|