• 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: Minimum number of digits validation and a '-'

Minimum number of digits validation and a '-' 11 years 3 weeks ago #27187

  • Huttanus
  • Huttanus's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 21
Hello
Can any one please help me out
I have a text field where the customer have to write a swedish birth date securit number.
the number looks like this XXXXXXXX-XXXX
the customer have to put exact the amount of digits. No more no less!
The administrator has disabled public write access.

Minimum number of digits validation and a '-' 10 years 11 months ago #27665

  • cosmin.cristea
  • cosmin.cristea's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 756
  • Thank you received: 144
One way to do this is by using the $invalid variable like in the example below:
if (strlen($_POST['form']['field_name_here']) != number_of_characters)
$invalid[] = RSFormProHelper::getComponentId("test");

this will check the string length and if it's different than the one you want it will not validate.
My help is not official customer support. To receive your support, submit a ticket by clicking 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!