Phone number input type for version 2.11.1

  • Christopher Hellweg
  • Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 3 months ago #130332 by Christopher Hellweg
Phone number input type for version 2.11.1 was created by Christopher Hellweg
I have a site that I would like to use the input type Tel so that it formats the phone number correctly. I cannot upgrade the site to a newer version of Joomla as the template doesn't support it. Is there any way to get a phone number formatting for the US in (715) 123-4567 to apply to a field in my version?

Please Log in or Create an account to join the conversation.

More
6 years 3 months ago #130337 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Phone number input type for version 2.11.1
Hello Christopher

Unfortunately, the Tel custom field type is only supported in later version of the extension, so the only way is updating to latest version or perform some customization to the code to have that feature (The field type is just standard html input type="Tel" developer.mozilla.org/en-US/docs/Web/HTML/Element/input/tel ), so honestly, I am unsure if it supports the US phone number format

Tuan

Please Log in or Create an account to join the conversation.

  • Christopher Hellweg
  • Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 3 months ago - 6 years 3 months ago #130340 by Christopher Hellweg
Replied by Christopher Hellweg on topic Phone number input type for version 2.11.1
I figured that was it but couldn’t find in the code where the field type drop down was to add it. I was able to update the phone type validation regex to be more strict but would love to update rest so input looks good too.
Last edit: 6 years 3 months ago by Christopher Hellweg.

Please Log in or Create an account to join the conversation.

More
6 years 3 months ago #130351 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Phone number input type for version 2.11.1
Hello

1. You can modify code in the file administrator/components/com_eventbooking/view/field/html.php to add Tel to field type dropdown

2. You will need to add a php file for that field type into administrator/components/com_eventbooking/libraries/rad/form/field folder. Maybe copy the file administrator/components/com_eventbooking/libraries/rad/form/field/text.php, rename it to tel.php, then modify code to make it become Tel field type

Hope it gives you alitle help

Tuan

Please Log in or Create an account to join the conversation.

Moderators: Tuan Pham Ngoc