• 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: Require min. # of selections in a checkbox group

Require min. # of selections in a checkbox group 10 years 1 month ago #30802

I have a form where users select the days of the week (Mon - Fri) in a checkbox group. The minimum number they have to select is 3 (out of 5). I can make the field required, but that only requires one box be checked. Is there a way I can require at least 3 or more are checked?
The administrator has disabled public write access.

Require min. # of selections in a checkbox group 10 years 1 month ago #30807

  • cosmin.cristea
  • cosmin.cristea's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 756
  • Thank you received: 144
This can be easily achieved with a script that counts how many items there are in the checkbox's array. To do this use the following script in the Scripts called on form process area :
if (count($_POST['form']['name_of_your_checkbox_group_field']) < 3){
 $invalid[] = RSFormProHelper::getComponentId("name_of_your_checkbox_group_field");
}

More information can be found here:
http://www.rsjoomla.com/support/documentation/view-article/602-php-scripts.html
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!