• Hi,
    What is correct way to set checkboxes checked on custom pdf?

    My solution for now is to check whenever there is the string in the array. But this is really hard and sort of static, because of the exact words.

    What I really was hoping, was a solution something like this:
    “if (‘{choise:66.1}’ != ”) echo ‘checked=”checked”‘;
    or
    “if (‘{choise:66.1:state}’ == ‘checked’) echo ‘checked=”checked”‘;

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Jake Jackson

    (@blue-liquid-designs)

    Hi!

    A few things:

    1. You’ll need to use our $form_data array in your conditionals, rather than merge tags. We have a section all about accessing checkbox data.

    2. You can dynamically display all available checkbox options using the $fields[ $id ]['choices'] array. Change $id to the field ID for your checkbox.

    3. Now you have access to all the available checkboxes ($fields) and all the selected checkboxes ($form_data), you can loop through them and then see if the choice has been selected.

    Thread Starter jwinnfield

    (@jwinnfield)

    Thank you so much!
    Works beautiful and seems to be right direction for the dynamic solution!
    Yep, I was using @form_data, just wanted to put mergetag on the table, just in case..

    • This reply was modified 9 years, 2 months ago by jwinnfield.
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘custom pdf checkboxes checked’ is closed to new replies.