• 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: Quaestion regarding Checkbox group processing

Quaestion regarding Checkbox group processing 9 years 9 months ago #31871

  • rajibu
  • rajibu's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 12
Hi,

I am building an application form where user will select courses from Checkbox Group. Once the form is submitted data will be emailed to the admin as PDF attachment. My question, is there any way I can show on my processed PDF which checkbok has been ticked rather than displaying the value of the checkbox (Preferably a tick mark in the box?

Example:
Checked (Yes/No)Name of the Course
Tick Mark or Y or NDiploma of Business

Regards
Raj
The administrator has disabled public write access.

Quaestion regarding Checkbox group processing 9 years 9 months ago #31881

  • cosmin.cristea
  • cosmin.cristea's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 756
  • Thank you received: 144
Have you tried using the placeholder {field_name:text} this works if you are creating your checkbox elements using the value | label syntax and you can find out more information here:

https://www.rsjoomla.com/support/documentation/rsform-pro/form-fields/checkbox-group.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.

Quaestion regarding Checkbox group processing 9 years 9 months ago #31891

  • rajibu
  • rajibu's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 12
Thanks for the update. placeholder {field_name:text} worked nicely. However, I am facing a small issue.

I have to list 10 Courses using checkbox and user must select at least one course out of 10. Since all my 10 courses are separate checkbox group, how can I make it mandatory so user are forced to select at least one checkbox out of 10.

Thanks
The administrator has disabled public write access.

Quaestion regarding Checkbox group processing 9 years 9 months ago #31900

  • adrianp
  • adrianp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 631
  • Thank you received: 146
Hello,

Either use a single checkbox group which you can make it required (thus, at least one selection will be mandatory in order to submit the form), or use a script within "Scripts Called On Form Process" that checks submitted values from your checkboxes.

The $invalid method, can be used to invalidate form fields.
This is not official customer support. To receive your support, submit a support ticket here.
Last Edit: 9 years 9 months ago by adrianp.
The administrator has disabled public write access.

Quaestion regarding Checkbox group processing 9 years 8 months ago #32017

  • rajibu
  • rajibu's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 12
Hi,

Thanks for the update.

Due to other cirsumstances each checkbox has its own checkgroup. There are total 3 checkbox groups and I have used the below script to check if at least one of more checkbox is selected. However, I am not getting the right outcome.

Sorry I am not from programming background.

if(!isset($_POST) || !isset($_POST) || !isset($_POST)){
$invalid[] = RSFormProHelper::getComponentId('course_ICT30115');
}
The administrator has disabled public write access.

Quaestion regarding Checkbox group processing 9 years 8 months ago #32018

  • adrianp
  • adrianp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 631
  • Thank you received: 146
Hello,

Try these steps:

- navigate to backend > Components > RSForm!Pro > Manage Forms > your form > Properties > PHP Scripts > "Scripts Called On Form Process" area.

- here, you can add (replace accordingly):
//replace the array elements with your exact checkbox names
$checkboxes = array('my-first-checkbox','another-checkbox','last-checkbox');
 
$selected = false;
foreach($checkboxes as $cbox){
	if(isset($_POST['form'][$cbox])){
		$selected = true;
		break;
	}
}
if($selected === false){
	//also replace the checkbox name here with one of your checkboxes
	$invalid[] = RSFormProHelper::getComponentId("my-first-checkbox");
	//this will be the checkbox that invalidates
}

- more details on RSForm!Pro PHP Scripts areas here.
This is not official customer support. To receive your support, submit a support ticket here.
The administrator has disabled public write access.

Quaestion regarding Checkbox group processing 9 years 8 months ago #32030

  • rajibu
  • rajibu's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 12
Thank you so much. It worked perfectly. Much appreciated.
The administrator has disabled public write access.

Quaestion regarding Checkbox group processing 9 years 8 months ago #32056

  • rajibu
  • rajibu's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 12
Hi,

The below code works perfectly. But I have multi-page form and I was wondering how can I trigger the code when the NEXT button is clicked rather than wait till the submit button is clicked on the last page.

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!