Validating Phone Number

Results 1 to 3 of 3

Thread: Validating Phone Number

  1. #1
    Join Date
    Dec 1969

    Default Validating Phone Number

    I need to validate a phone number field. I use the IsNumeric function to ckeck is the field is numeric. My problem is that I need to allow for - and (). ie (555)555-5555 or 555-555-5555 or just 5555555555.<BR><BR>Thanks in advance

  2. #2
    Join Date
    Dec 1969

    Default RE: Validating Phone Number

    Try This (may not be the BEST code, but should work):<BR><BR>p = request.form("formvariablename")<BR>p = replace(p, "-", "")<BR>p = replace(p, "(", "")<BR>p = replace(p, ")", "")<BR><BR>if not IsNumeric(p) and Len(p) &#060;&#062; 10 then<BR> &#039 invalid phone #<BR>end if<BR><BR>Later

  3. #3
    Skippie Guest

    Default RE: Validating Phone Number

    What about business that like to substitute letters?<BR><BR>Here&#039s a fictitious example:<BR><BR>1-800-FOR-EYES instead of 1-800-367-3937<BR><BR><BR><BR><BR>-- Skippie<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts