Using Checkboxes In NetSuite Advance PDF (Freemarker)

Written by Dylan Coetzee

August 31, 2021

Checkboxes in Advance PDF’s can be quite tricky, you might experience the following issues:

  1. Checkbox not setting as checked.
  2. Cannot display the label of the checkbox in the same line.

How to mark a checkbox as checked with an if statement:

In the following piece of code, I am marking the checkbox based on the approval status field of the Sales Order, if it is equal to pending approval I will mark the checkbox as true.

<input type=”checkbox” id=”approvalstatus” name=”approvalstatus” value=”1″ checked=”${(orderstatus== ‘Pending Approval’)?string(‘true’, ‘false’)}” style=”inline-block;” display=”inline”/><label for=”carrier”> Pending Approval</label>

Newer version of freemarker use: checked=”${(orderstatus== ‘Pending Approval’)?c}”

If your checkbox isn’t set to true or false ensure that you do not have duplicate IDs and names in the same HTML structure.

To put your label and the checkbox in the same line, add the following code to the input checkbox tag: style=”inline-block;” display=”inline” review the sample code above.

You May Also Like…


Submit a Comment

Your email address will not be published.