Skip to main content
ZBen
Known Participant
Jul 27, 2018 1:22 PM UTC
Answered

How do I mirror information from one set of fillable fields to another using a checkbox or drop down menu?

I am using Adobe Acrobat DC Professional. I am creating a user filled PDF. What I want to be able to do is once they fill out a column of information, in the next column, have a check box that asks if this column is the same as the first. If they click Yes, that column's fields auto populate with the first column's information. I am also trying to do the same function on the same form but the user will select using a drop down menu of which columns they want to mirror. Thanks for any help!

This topic is closed to new replies. Start a new post to keep the conversation going.
try67
try67Correct answer
Community Expert
Jul 27, 2018 4:44 PM UTC

The first part is easily done, the second part is much more complicated.

To do the first you just need to add something like this as the check-box's Mouse Up event:

if (event.target.value!="Off") {

     this.getField("Target1").value = this.getField("Source1").valueAsString;

     this.getField("Target2").value = this.getField("Source2").valueAsString; // etc.

}

19 replies

ZBen
ZBenAuthor
Known Participant
Jul 27, 2018 6:47 PM UTC

Thank you so much! It works perfectly. How about if I want, when the box is unselected, the fields that were autofilled go blank?

Translate
try67
Community Expert
Community Expert
Jul 27, 2018 7:10 PM UTC

Then add this after the code above:

else {

     this.getField("Target1").value = "";

     this.getField("Target2").value = ""; // etc.

}

Translate
ZBen
ZBenAuthor
Known Participant
Jul 27, 2018 7:19 PM UTC

Thank you! This answers my question for the check box.

Do you by chance have a solution to the drop down selection? Again, the idea is in the form you can select a column of information to choose from to mirror rather than having only one option.

Translate
try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
Jul 27, 2018 4:44 PM UTC

The first part is easily done, the second part is much more complicated.

To do the first you just need to add something like this as the check-box's Mouse Up event:

if (event.target.value!="Off") {

     this.getField("Target1").value = this.getField("Source1").valueAsString;

     this.getField("Target2").value = this.getField("Source2").valueAsString; // etc.

}

Translate