How to Copy Text Field Values Using a Checkbox in Adobe Acrobat
Question details
The user needs a method to automatically duplicate a value entered in one text field into multiple other fields when a specific checkbox is selected in a PDF form.

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- Designing an interactive PDF form where repetitive data entry needs to be automated using a checkbox trigger.
- Observed behavior
- The user wants to execute a JavaScript action via a checkbox to push data from a source field (e.g., Monday) to target fields (e.g., Tuesday through Friday).
Ensure you are using Adobe Acrobat Pro, as the free Adobe Acrobat Reader does not support the creation or editing of form fields and JavaScript actions. Verify the exact, case-sensitive names of your text fields before proceeding.
Add a JavaScript Action to the Checkbox
Use a custom JavaScript action triggered by the 'Mouse Up' event on the checkbox to copy the values automatically.
By applying a short JavaScript snippet to your checkbox, you can command Adobe Acrobat to fetch the value from a source field and populate it into as many target fields as you need, but only when the checkbox is actively checked.
Open your PDF document in Adobe Acrobat. Go to 'Tools' and select 'Prepare Form' to enable the form editing tools.
Locate the checkbox you want to use as the trigger. Right-click the checkbox and select 'Properties' from the context menu.
In the Properties dialog box, navigate to the 'Actions' tab. Click the 'Select Trigger' dropdown menu and choose 'Mouse Up'.
Click the 'Select Action' dropdown menu, choose 'Run a JavaScript', and then click the 'Add' button.
In the JavaScript Editor window, enter your script. Use this format: if (event.target.value !== 'Off') { this.getField('TargetField').value = this.getField('SourceField').value; }. Replace 'TargetField' and 'SourceField' with your actual field names. Click 'OK' to save.

Looking for a Lightweight and Powerful PDF Editor?
WPS Office is a free, lightweight Microsoft Office alternative offering high format compatibility, a familiar UI, and seamless migration. It includes a powerful built-in PDF editor to meet all your document management needs without heavy system requirements.
- 1. Download and Install WPS Office: Visit the official WPS Office website to download the installer and follow the on-screen instructions to install the suite.
- 2. Open Your PDF Document: Launch WPS Office, click on 'Open', and select your PDF file to view or edit it using the built-in PDF tools.
- 3. Manage Documents Efficiently: Utilize the intuitive ribbon interface to edit PDF text, manage pages, or easily convert PDFs to Word, Excel, or PowerPoint formats.

Frequently Asked Questions
Why is my JavaScript not copying the text field values in Acrobat?
This usually happens if the field names in your script do not exactly match the field names in your form. Check for typos and ensure correct capitalization, as JavaScript field referencing is case-sensitive.
Can I clear the copied fields if the user unchecks the box?
Yes. You can add an 'else' block to your JavaScript that sets the target fields to an empty string (e.g., this.getField('Tuesday').value = '';) when the checkbox value is 'Off'.
Does this JavaScript work when users fill out the form in free PDF readers?
Yes, scripts that copy field values generally function correctly in free readers like Adobe Acrobat Reader when users are filling out the form. However, you must use Acrobat Pro to create and embed the script initially.
Can I copy values instantly without using a checkbox?
Yes. Instead of using a checkbox, you can attach an 'On Blur' custom keystroke script to the source text field. This will push the data to the target fields immediately after the user clicks away from the source field.




