|
|
@@ -21,7 +21,7 @@
|
|
|
},
|
|
|
|
|
|
// The supported countries
|
|
|
- COUNTRY_CODES: ['BR', 'ES', 'FR', 'GB', 'MA', 'PK', 'US'],
|
|
|
+ COUNTRY_CODES: ['BR', 'ES', 'FR', 'GB', 'MA', 'PK', 'US', 'CN'],
|
|
|
|
|
|
/**
|
|
|
* Return true if the input value contains a valid phone number for the country
|
|
|
@@ -97,7 +97,12 @@
|
|
|
value = $.trim(value);
|
|
|
isValid = (/^0?3[0-9]{2}[0-9]{7}$/).test(value);
|
|
|
break;
|
|
|
-
|
|
|
+
|
|
|
+ case 'CN':
|
|
|
+ //http://regexr.com/39dq4
|
|
|
+ value = $.trim(value);
|
|
|
+ isValid = (/^((00|\+)?(86(?:-| )))?((\d{11})|(\d{3}[- ]{1}\d{4}[- ]{1}\d{4})|((\d{2,4}[- ]){1}(\d{7,8}|(\d{3,4}[- ]{1}\d{4}))([- ]{1}\d{1,4})?))$/).test(value);
|
|
|
+ break;
|
|
|
case 'US':
|
|
|
/* falls through */
|
|
|
default:
|