PDF Editing Issues

How to Auto-Copy Address Fields Using a Checkbox in Acrobat PDF Forms

Anum MushtaqAnum Mushtaq Nov 5, 2026 869 views

Question details

The user needs to automatically populate a set of address fields (e.g., Mother's address) with the data from another set of fields (e.g., Father's address) whenever a specific checkbox is ticked.

How to Auto-Copy Address Fields Using a Checkbox in Acrobat PDF Forms
Product
Adobe Acrobat
Device & OS
not provided
Scenario
Creating or editing an interactive, fillable PDF form that requires conditional logic to duplicate user input.
Observed behavior
Requires a custom JavaScript calculation script that recognizes the checkbox state and accurately transfers text field values across the document.
Before you start

Before applying the script, verify the exact internal names of your text fields and the checkbox in your PDF editor. Form field scripts are case-sensitive and require perfect string matches to function properly.

Solution 1Recommended

Add a Custom Calculation Script to Destination Fields

Use a custom JavaScript snippet in the destination text fields to pull data from the source fields whenever the checkbox is activated.

This method involves applying a simple conditional statement to your destination fields. If the specified checkbox (e.g., 'SameasFather') is checked (its value is not 'Off'), the script sets the current field's value to match the corresponding source field.

1
Enter Form Preparation Mode

Open your PDF document in Adobe Acrobat, go to the 'Tools' menu, and select 'Prepare Form'.

2
Access Destination Field Properties

Right-click on the destination text field where the copied address should appear (e.g., MotherMailingAddress) and choose 'Properties'.

3
Open the Calculate Tab

In the Properties window, navigate to the 'Calculate' tab and select the 'Custom calculation script' radio button.

4
Insert the JavaScript Code

Click the 'Edit' button and paste the following logic: if (this.getField("SameasFather").valueAsString != "Off") { this.getField("MotherMailingAddress").value = this.getField("FatherMailingAddress").value; } Update the field names to match your form perfectly.

5
Repeat for Additional Fields

If you have secondary address lines, append them inside the same bracket, like: this.getField("MotherMailingAddress_2").value = this.getField("FatherMailingAddress_2").value;

6
Test Your Form

Click 'Close' to save the properties, exit the form editing mode, and test the checkbox to ensure the text fields auto-fill successfully.

Add a Custom Calculation Script to Destination Fields
Export Values: By default, an unchecked box has an export value of 'Off'. Ensure your checkbox properties use standard export values so the != 'Off' logic triggers correctly.
Comprehensive PDF Editor

Manage and Fill Interactive PDF Forms with WPS Office

If you need an efficient, cost-effective way to view, fill, and manage smart PDF forms, WPS Office provides a robust PDF editor that seamlessly handles interactive document elements.

  1. 1. Launch WPS Office: Open the WPS Office application and navigate to the 'PDF' section from the main dashboard.
  2. 2. Open Your Form: Click 'Open' and select your interactive PDF form from your local files or cloud storage.
  3. 3. Interact with Fields: Click directly into the fillable areas. The software fully supports standard form interactions, allowing checkboxes and text fields to respond instantly.
  4. 4. Save and Export: Once your data is entered, easily save your completed form or export a flattened copy to share.
Fully compatible with standard interactive PDF form fields and elements.Seamlessly compatible with Microsoft Office formats (Word, Excel, PowerPoint) and standard PDFs.Lightweight performance ensures complex or script-heavy PDFs open rapidly.Cross-platform accessibility for Windows, Mac, iOS, and Android.
microsoft office alternative - wps office

Frequently Asked Questions

Why is my PDF calculation script not copying the text?

This usually happens if the field names in your script do not exactly match the actual form fields in your document. JavaScript is case-sensitive, so double-check for typos. Additionally, ensure the checkbox export value behaves as expected (typically 'Off' when unchecked).

Should I put the calculation script on the text field or the checkbox itself?

For reliable automatic updates, it is highly recommended to place the custom calculation script in the Calculate tab of the destination text field. Alternatively, an Action script (using the 'Mouse Up' trigger) can be applied directly to the checkbox to push values, but calculation scripts are standard for this scenario.

Can I auto-fill multiple fields with a single checkbox?

Yes. You can expand the JavaScript snippet to populate as many fields as needed. Simply add another assignment line inside the 'if' statement for each destination field, such as copying the City, State, and Zip Code fields simultaneously.