javascript Validate Phone Number

function ValidatePhone(strString){
   var strValidChars = "+()0123456789.ext ";
   var strChar;
   var blnResult = true;

   if (strString.length < 11) return false;

   for (i = 0; i < strString.length && blnResult == true; i++)
      {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
         {
         blnResult = false;
         }
      }
   return blnResult;
}
Validates a Phone Number

Updated: Friday 1st October 2010, 07:05pm

There are 0 comments

Leave a comment of your own

Comments are currently closed.