Using check box

This walkthrough demonstrate how to detect and control the state of check boxes. We will create three check boxes and implement the logic that if the first box is checked the other two will be checked as well.

The files used in this walkthrough can be downloaded here: checkbox.docand checkbox.pdf.

  1. Launch Microsoft Word. Choose CenoPDF > Add Check Box to add three check boxes and name them as selectall, box1 and box2.
  2. Go to the properties dialog box of the selectallcheck box and choose Actions tab > Mouse Up trigger > Add button > JavaScriptAction Type.
  3. Copy and paste the following script in the JavaScript box:

    if(this.getField("selectall").isBoxChecked(0))
    {
        this.getField("box1").checkThisBox(0, true);
        this.getField("box2").checkThisBox(0, true);
    }

  4. Choose command CenoPDF > Export to PDF.