• 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: Validation of all checkbox listed

Validation of all checkbox listed 10 years 10 months ago #28135

  • pwickert
  • pwickert's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 15
  • Thank you received: 2
On a checkbox field I have a list of 7 affirmations that the user need to check before able to submit (User need to check all of them). Is there a way to do that?

Thank you
Last Edit: 10 years 10 months ago by pwickert.
The administrator has disabled public write access.

Validation of all checkbox listed 10 years 9 months ago #28139

How about making each checkbox its own checkgroup so that you can set each one as required?
The administrator has disabled public write access.

Validation of all checkbox listed 10 years 9 months ago #28144

  • 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 $_POST 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']) != 7){
 $invalid[] = RSFormProHelper::getComponentId("name_of_your_checkbox_group_field");
}
My help is not official customer support. To receive your support, submit a ticket by clicking here
The administrator has disabled public write access.

Validation of all checkbox listed 10 years 9 months ago #28154

  • pwickert
  • pwickert's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 15
  • Thank you received: 2
Thank you "nathanhawks" for your response. I thought about this solution but I was wondering if a more quickier one was possible (it is faster and easier to manage a list of items within a checkbox group list rather than having multiple checkbox group). Still something to consider though.
Last Edit: 10 years 9 months ago by pwickert.
The administrator has disabled public write access.

Validation of all checkbox listed 10 years 9 months ago #28155

  • pwickert
  • pwickert's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 15
  • Thank you received: 2
cosmin.cristea wrote:
This can be easily achieved with a script that counts how many items there are in the $_POST 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']) != 7){
 $invalid[] = RSFormProHelper::getComponentId("name_of_your_checkbox_group_field");
}

I'll try that tomorrow. Thank you cosmin.cristea!
The administrator has disabled public write access.

Validation of all checkbox listed 10 years 9 months ago #28200

  • pwickert
  • pwickert's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 15
  • Thank you received: 2
It worked like a charm.

Thanks!
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!