|
@@ -7,6 +7,7 @@
|
|
|
BR: 'Brazil',
|
|
BR: 'Brazil',
|
|
|
CN: 'China',
|
|
CN: 'China',
|
|
|
CZ: 'Czech Republic',
|
|
CZ: 'Czech Republic',
|
|
|
|
|
+ DE: 'Germany',
|
|
|
DK: 'Denmark',
|
|
DK: 'Denmark',
|
|
|
ES: 'Spain',
|
|
ES: 'Spain',
|
|
|
FR: 'France',
|
|
FR: 'France',
|
|
@@ -29,7 +30,7 @@
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
// The supported countries
|
|
// The supported countries
|
|
|
- COUNTRY_CODES: ['BR', 'CN', 'CZ', 'DK', 'ES', 'FR', 'GB', 'MA', 'PK', 'RO', 'RU', 'SK', 'TH', 'US', 'VE'],
|
|
|
|
|
|
|
+ COUNTRY_CODES: ['BR', 'CN', 'CZ', 'DE', 'DK', 'ES', 'FR', 'GB', 'MA', 'PK', 'RO', 'RU', 'SK', 'TH', 'US', 'VE'],
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* Return true if the input value contains a valid phone number for the country
|
|
* Return true if the input value contains a valid phone number for the country
|
|
@@ -85,6 +86,12 @@
|
|
|
isValid = /^(((00)([- ]?)|\+)(420)([- ]?))?((\d{3})([- ]?)){2}(\d{3})$/.test(value);
|
|
isValid = /^(((00)([- ]?)|\+)(420)([- ]?))?((\d{3})([- ]?)){2}(\d{3})$/.test(value);
|
|
|
break;
|
|
break;
|
|
|
|
|
|
|
|
|
|
+ case 'DE':
|
|
|
|
|
+ // Test: http://regexr.com/39pkg
|
|
|
|
|
+ value = $.trim(value);
|
|
|
|
|
+ isValid = (/^(((((((00|\+)49[ \-/]?)|0)[1-9][0-9]{1,4})[ \-/]?)|((((00|\+)49\()|\(0)[1-9][0-9]{1,4}\)[ \-/]?))[0-9]{1,7}([ \-/]?[0-9]{1,5})?)$/).test(value);
|
|
|
|
|
+ break;
|
|
|
|
|
+
|
|
|
case 'DK':
|
|
case 'DK':
|
|
|
// Mathing DK phone numbers with country code in 1 of 3 formats and an
|
|
// Mathing DK phone numbers with country code in 1 of 3 formats and an
|
|
|
// 8 digit phone number not starting with a 0 or 1. Can have 1 space
|
|
// 8 digit phone number not starting with a 0 or 1. Can have 1 space
|