How to Auto-Copy Address Fields Using a Checkbox in Acrobat PDF Forms
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.

- 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 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.
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.
Open your PDF document in Adobe Acrobat, go to the 'Tools' menu, and select 'Prepare Form'.
Right-click on the destination text field where the copied address should appear (e.g., MotherMailingAddress) and choose 'Properties'.
In the Properties window, navigate to the 'Calculate' tab and select the 'Custom calculation script' radio button.
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.
If you have secondary address lines, append them inside the same bracket, like: this.getField("MotherMailingAddress_2").value = this.getField("FatherMailingAddress_2").value;
Click 'Close' to save the properties, exit the form editing mode, and test the checkbox to ensure the text fields auto-fill successfully.

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. Launch WPS Office: Open the WPS Office application and navigate to the 'PDF' section from the main dashboard.
- 2. Open Your Form: Click 'Open' and select your interactive PDF form from your local files or cloud storage.
- 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. Save and Export: Once your data is entered, easily save your completed form or export a flattened copy to share.

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.




