CHECKBOXES - OUTPUT TO TCPDF VALUES

msreyes 14 Jul, 2022
My form works fine.... I have checkboxes with the following values (any or all can be checked):

GENERAL CLEAN=GENERAL CLEAN
REPAIR=REPAIR
OTHER=OTHER

On my PDF form I have these three options. I am trying to figure out how to output that with either YES or NO... thoughts in the action is an if statement where if "GENERAL CLEAN" is selected the variable would be YES, otherwise NO.

It's the if statement I am struggling with.
msreyes 15 Jul, 2022
Answer
Ok, I figured it out.... in the ACTIONS section add PHP. This is my PHP code:
$newstring = $this->data("services_to_be_performed");
$yes = "YES";
$no = "NO";
if (in_array("OTHER", $newstring))
{
return $yes;
}
else
{
return $no;
}
Then for each one I check on the PDF, add {var:php10} variable for example.
You need to login to be able to post a reply.

VPS & Email Hosting 20% discount
hostinger