×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Javascript
Posted by: Jing Tai Piao
Added: Jun 27, 2013 6:40 AM
Views: 22
Tags: no tags
  1. var phoneArray = new Array(
  2. '## #### ####',
  3. '(##) #### ####',
  4. '### #### ####',
  5. '(+##) #### ####',
  6. '(+###) #### ####',
  7. '##########'
  8. );
  9. phone_number = value.replace(/\s+/g, "");
  10. phone_number = value.replace(/\d/g, "#");
  11. console.log(phone_number);
  12. var isValided = false;
  13. $.each(phoneArray, function(k, v){
  14. if($.trim(v) == $.trim(phone_number)) {
  15. isValided = true;
  16. }
  17. });