• 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: Telephone input mask

Telephone input mask 1 month 3 weeks ago #43286

I have been searching for code to do an input mask for a telephone field in the format of xxx-xxx-xxxx. Found a post from 14+ years ago that placed code in " components/com_rsform/controller/validation.php". Code was this:

function phone($phone)
{
list($number1,$number2,$number3)=split("-",$phone,3);
if($phone=='' || strlen($phone)!=10 || !(is_numeric($number1)) || !(is_numeric($number2)) || !(is_numeric($number3)) || strlen($number3)!=2) return false;
if(ereg('^([0-9]{4})-([0-9]{4})-([0-9]{3})$', $phone))
return false;
else
return true;
}

I created the file in the directory indicated and copied the code into it. The code had no impact on the user entry for a phone number field or in the data stored. The text field is set to validate a telephone number. The field Validation/Required attribute is set to "No".

What am I missing or has something changed in the RS Forms code since the previous post?
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!