• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: need help with validating phone number

need help with validating phone number 13 years 7 months ago #11459

  • ayottem
  • ayottem's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 1
I've pasted the code on the forum in my validation php file (and customized it for 999-999-9999 formatting). This still does not work. Does anyone have a script that will actually work? Entering a phone number without dashes separating the numbers is not intuitive or user friendly. Virtually everyone will input a phone number this way. Not sure why this can't be added in at this point or at the very least allow the alphanumeric validation script to work on phone number text fields.
The administrator has disabled public write access.

Re:need help with validating phone number 13 years 7 months ago #11484

  • andreic
  • andreic's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 722
  • Thank you received: 59
Hello,

You can refer to the following forum post regarding this topic:

www.rsjoomla.com/customer-support/forum/...imit=6&;start=6#7760
Please note: my help is not official customer support. To receive your support, submit a ticket by clicking here
Regards,
RSJoomla! Development Team
The administrator has disabled public write access.

Re:need help with validating phone number 13 years 7 months ago #11533

  • jondiego
  • jondiego's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
I use this one and it works great.
function phone($phone) { 
    $phone_2 = preg_replace('/[^0-9]+/', '', $phone ); 
    if($phone_2=='') return true; 
    $len = strlen($phone_2); 
    if($len == 10 || $len == 11) { 
        return true; 
    } else { 
        return false; 
    } 
}
The administrator has disabled public write access.

Re:need help with validating phone number 12 years 10 months ago #14069

That's great! Can you tell me what format this code will accept?
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!