• 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: Make at least one text input compulsory

Make at least one text input compulsory 11 years 11 months ago #23310

I have 3 text input for inserting phone numbers:
Office, Mobile, Fax

How can I ensure that users enter at least one of the fields?
They can either fill 2 or all 3 if they want to, but at least 1 must be filled.

Can anyone help?

Thanks in advance!
The administrator has disabled public write access.

Make at least one text input compulsory 11 years 11 months ago #23418

  • alexp
  • alexp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 2253
  • Thank you received: 180
Hello,

You can implement this using the $invalid method, as explained here:

http://www.rsjoomla.com/support/documentation/view-article/602-php-scripts.html

Example:
if($_POST['form']['field1'] == '' && $_POST['form']['field2'] == '' && $_POST['form']['field3'] == '')
$invalid[] = RSFormProHelper::getComponentId("field1");
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.
  • 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!