| 2 |
lars |
1 |
/**
|
|
|
2 |
* Polish telephone numbers have 9 digits.
|
|
|
3 |
*
|
|
|
4 |
* Mobile phone numbers starts with following digits:
|
|
|
5 |
* 45, 50, 51, 53, 57, 60, 66, 69, 72, 73, 78, 79, 88.
|
|
|
6 |
*
|
|
|
7 |
* Fixed-line numbers starts with area codes:
|
|
|
8 |
* 12, 13, 14, 15, 16, 17, 18, 22, 23, 24, 25, 29, 32, 33,
|
|
|
9 |
* 34, 41, 42, 43, 44, 46, 48, 52, 54, 55, 56, 58, 59, 61,
|
|
|
10 |
* 62, 63, 65, 67, 68, 71, 74, 75, 76, 77, 81, 82, 83, 84,
|
|
|
11 |
* 85, 86, 87, 89, 91, 94, 95.
|
|
|
12 |
*
|
|
|
13 |
* Ministry of National Defence numbers and VoIP numbers starts with 26 and 39.
|
|
|
14 |
*
|
|
|
15 |
* Excludes intelligent networks (premium rate, shared cost, free phone numbers).
|
|
|
16 |
*
|
|
|
17 |
* Poland National Numbering Plan http://www.itu.int/oth/T02020000A8/en
|
|
|
18 |
*/
|
|
|
19 |
$.validator.addMethod( "phonePL", function( phone_number, element ) {
|
|
|
20 |
phone_number = phone_number.replace( /\s+/g, "" );
|
|
|
21 |
var regexp = /^(?:(?:(?:\+|00)?48)|(?:\(\+?48\)))?(?:1[2-8]|2[2-69]|3[2-49]|4[1-68]|5[0-9]|6[0-35-9]|[7-8][1-9]|9[145])\d{7}$/;
|
|
|
22 |
return this.optional( element ) || regexp.test( phone_number );
|
|
|
23 |
}, "Please specify a valid phone number" );
|