Browse Source

Update phone.js

Correct the separator after the international prefix.
And now, all the four separator between the pairs of digits in the national part must be identical.
Daniel Lucazeau 11 years ago
parent
commit
12bac932b3
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/js/validator/phone.js

+ 2 - 2
src/js/validator/phone.js

@@ -65,9 +65,9 @@
                     break;
 
                 case 'FR':
-                    // http://regexr.com/395dq
+                    // http://regexr.com/39a2p
                     value = $.trim(value);
-                    isValid = (/^(?:(?:(?:\+|00)33\D?(?:\D?\(0\)\D?)?)|0){1}[1-9]{1}(?:\D?\d{2}){4}$/).test(value);
+                    isValid = (/^(?:(?:(?:\+|00)33[ ]?(?:\(0\)[ ]?)?)|0){1}[1-9]{1}([ .-]?)(?:\d{2}\1?){3}\d{2}$/).test(value);
                     break;
 
                 case 'US':