• 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: Separate checkbox responses

Separate checkbox responses 11 years 8 months ago #24764

When using the checkbox field for selecting multiple answers, if more than one checkbox is checked the responses come through in one long line. I'd like to be able to separate multiple checkbox responses with either a line break or a dividing character (maybe | or something similar).

How do I do this????!
The administrator has disabled public write access.

Separate checkbox responses 11 years 8 months ago #24767

Hello Louise,

You can process the checkbox group's value by using a PHP script called on form process. The script in question can be added in Components > RSForm!Pro > Manage Forms > edit your form > Properties > PHP Scripts > Scripts called on form process.

For your particular case you can use something like the following:
$_POST['form']['Radio_Group_Name'] = implode('your_separator', $_POST['form']['Radio_Group_Name']);
Please remember that my responses aren't considered customer support, to receive customer support please submit a new customer support ticket, and we will gladly assist you.

Best Regards,
Cristian Nicolae.
Last Edit: 11 years 8 months ago by cristian.nicolae.
The administrator has disabled public write access.
The following user(s) said Thank You: indrek.viron

Separate checkbox responses 11 years 7 months ago #25027

If the field left blank, then will give an error message: Warning: implode() [function.implode]: Invalid arguments passed in /administrator/components/com_rsform/helpers/rsform.php(2027) : eval()'d code on line 2
The administrator has disabled public write access.

Separate checkbox responses 11 years 7 months ago #25034

Hello indrek.viron,

This can be corrected by simply placing the implode statement in an if:
if(count($_POST['form']['Checkbox_Group_Name']) > 0)
$_POST['form']['Checkbox_Group_Name'] = implode('your_separator', $_POST['form']['Checkbox_Group_Name']);
... which will execute the implode code only if the user selects an option in the checkbox group.
Please remember that my responses aren't considered customer support, to receive customer support please submit a new customer support ticket, and we will gladly assist you.

Best Regards,
Cristian Nicolae.
Last Edit: 11 years 7 months ago by cristian.nicolae.
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!