浏览代码

Merge branch 'adrian-dks-patch-1'

phuoc 11 年之前
父节点
当前提交
3c9b775984
共有 1 个文件被更改,包括 8 次插入1 次删除
  1. 8 1
      src/js/validator/phone.js

+ 8 - 1
src/js/validator/phone.js

@@ -11,6 +11,7 @@
             GB: 'United Kingdom',
             GB: 'United Kingdom',
             MA: 'Morocco',
             MA: 'Morocco',
             PK: 'Pakistan',
             PK: 'Pakistan',
+            RO: 'Romania',
             US: 'USA'
             US: 'USA'
         }
         }
     });
     });
@@ -22,7 +23,7 @@
         },
         },
 
 
         // The supported countries
         // The supported countries
-        COUNTRY_CODES: ['BR', 'CN', 'ES', 'FR', 'GB', 'MA', 'PK', 'US'],
+        COUNTRY_CODES: ['BR', 'CN', 'ES', 'FR', 'GB', 'MA', 'PK', 'RO', 'US'],
 
 
         /**
         /**
          * 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
@@ -104,6 +105,12 @@
                     value   = $.trim(value);
                     value   = $.trim(value);
                     isValid = (/^0?3[0-9]{2}[0-9]{7}$/).test(value);
                     isValid = (/^0?3[0-9]{2}[0-9]{7}$/).test(value);
                     break;
                     break;
+                    
+        		case 'RO':
+        		    // Phone intl/national
+        		    // All mobile network and land line.
+        		    isValid = (/^(\+4|)?(07[0-8]{1}[0-9]{1}|02[0-9]{2}|03[0-9]{2}){1}?(\s|\.|\-)?([0-9]{3}(\s|\.|\-|)){2}$/g).test(value);
+                    break;
 
 
                 case 'US':
                 case 'US':
                 /* falls through */
                 /* falls through */