Skip to main content
Participant
February 16, 2018
Question

Help! Checkbox on one page turns on checkbox on other page?

  • February 16, 2018
  • 1 reply
  • 732 views

I know virtually nothing about coding, so please be gentle I have a list of items with checkboxes and I want to have a checkbox on one page in a PDF form get checked (turned on) when a user checks a box on the previous page.

The checkbox on the first page is named "Redundant" and the checkbox on page 2 is named "Reach".

I've tried to use code for what sounds like the same question, for example: if (this.getField("Redundant").value!="On") this.getField("Reach").value = "On";

...but that didn't work, nor did others. Acrobat accepted that code (no errors), but when I tried to test it, the second checkbox didn't get checked. 

As I said, though, I'm not a coder and this is as close to a foreign language as it gets for me!

I feel like this should be simple -- check a box on one page so another box gets checked on another.

Please help! I'm using Acrobat Pro DC. Thanks thanks thanks!!

This topic has been closed for replies.

1 reply

Thom Parker
Community Expert
Community Expert
February 16, 2018

First, you don't need any code for this. Just give the checkboxes the same name and they'll get the same value. 

This technique works as along as the checkboxes always need to be in sync.  A script is only useful in the situation where the relationship is more complicated. 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
Participant
February 16, 2018

Thank you, but it is actually more complicated. In the list on the first page, there are seven items in the list that map to four options on the second page, so there's not a one-to-one relationship. So, if any of three different options in the list are checked, one of the boxes on the second page will get turned on, or if two of the others get checked, then another box gets turned on, etc.

I do appreciate your help, though!

Thom Parker
Community Expert
Community Expert
February 16, 2018

Well, that is significantly more difficult than the original question.  When you post to this forum it is important to clearly describe the task you want to accomplish.  You're initial question would not have led to a usable answer.

The situation you've described is different arrangements of multiple checkboxes modifying multiple checkboxes. This cannot be handled with a MouseUp event, which is what I imagine you are using for the scripts you've tested.

The correct way to handle this is to use a calculation script on the target checkboxes. But this is beyond your stated skill set. So I would suggest one of two strategies.

1. Add a hidden text field and use the Calculation script on the text field to set the checkbox values. To do this you'll need to learn some scripting basics.

2. Hire a professional.

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often