• 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: Field Validation - date and phone format

Field Validation - date and phone format 12 years 8 months ago #19122

  • fdigital01
  • fdigital01's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 33
  • Thank you received: 1
how can i set the field validation so that it requires a certain format for:

1) date field: dd/mm/yyyy
2) phone number: 12345678

thank you
The administrator has disabled public write access.

Re: Field Validation - date and phone format 12 years 8 months ago #19123

  • adrianp
  • adrianp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 631
  • Thank you received: 146
Hello ,

Validations for :

1) You can use Calendar field component for your date format.

2)For your phone number validation you will have to add a custom script in "your form > Properties > PHP Scripts > script called on form process tab" , script :

**********************************************
$limit = 8;

if (strlen($_POST) < $limit)

$invalid[] = RSFormProHelper::getComponentId("phonenumber");
**********************************************

Replace "phonenumber" with your field id.

Next thing to do is to edit the textbox component:

-validate the textbox , edit the component , go to Validations and as a Validation Rule select "Numeric".

-limit the numbers that can be inserted in the textbox , edit the textbox component , go to Attributes tab and insert the maximum lenght in the "Max Size" field.
This is not official customer support. To receive your support, submit a support ticket here.
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!