PDF Editing Issues

How to Autofill Acrobat Form Fields After a Check Box Selection

Steven ParkerSteven Parker Oct 28, 2026 868 views

Question details

The user wants to automatically populate specific fields in a PDF form with existing data when a check box is selected, and clear the data when it is deselected.

How to Autofill Acrobat Form Fields After a Check Box Selection
Product
Adobe Acrobat
Device & OS
not provided
Scenario
Creating an interactive PDF form where certain fields replicate data (such as a 'Shipping same as Billing' option) based on user interaction.
Observed behavior
Needs a method to trigger data copying between defined form fields dynamically upon checking a box, including logic to reverse the action.
Before you start

Ensure you have noted the exact field names for both the source data fields and the destination fields before you begin writing your script, as JavaScript is case-sensitive.

Solution 1Recommended

Configure a Mouse Up Action with Custom JavaScript

Use Adobe Acrobat's built-in JavaScript capabilities to detect the checkbox state and copy data between fields accordingly.

By applying a custom script to the check box's properties, you can command the form to extract values from source fields and insert them into target fields whenever the user releases their mouse button over the check box.

1
Open Check Box Properties

Enter 'Prepare Form' mode in Adobe Acrobat, right-click the target check box, and select 'Properties' from the context menu.

2
Navigate to the Actions Tab

Click on the 'Actions' tab at the top of the Properties dialog box. Set the 'Select Trigger' dropdown to 'Mouse Up'.

3
Add JavaScript Action

In the 'Select Action' dropdown, choose 'Run a JavaScript', then click the 'Add...' button to open the JavaScript editor window.

4
Input the Autofill Script

Write a script that checks the event value. For example: if (event.target.isBoxChecked(0)) { this.getField('TargetField').value = this.getField('SourceField').value; } else { this.getField('TargetField').value = ''; }. Click OK to save.

Handling Checkbox States: Ensure you include an 'else' block in your script to clear the target fields when the check box is deselected, preventing unwanted data retention.
Easily Manage PDF Forms

Create and Fill Interactive PDF Forms with WPS Office

WPS Office provides robust and intuitive PDF tools, allowing you to seamlessly create, edit, and fill interactive PDF forms without the need for complex enterprise software.

  1. 1. Open your PDF: Launch WPS Office and open the PDF document you wish to edit or fill.
  2. 2. Access Form Tools: Navigate to the 'Form' tab in the top ribbon to access the suite of interactive form controls.
  3. 3. Insert Form Fields: Select the 'Check Box' or 'Text Field' tool and drag on the document page to place your new field.
  4. 4. Edit Properties: Double-click the inserted field to modify its name, appearance, and specific interactive properties.
Easily add text fields, check boxes, and drop-down menus to your PDFs.Fully compatible with standard Adobe Acrobat PDF form formats.A lightweight, user-friendly interface that simplifies document processing.Supports quick form filling, saving, and secure sharing.
microsoft office alternative - wps office

Frequently Asked Questions

Why isn't the data clearing when I uncheck the box?

Your JavaScript needs an 'else' condition to handle the deselected state. If the check box is toggled off, you must explicitly instruct the script to set the target field values to an empty string (e.g., '') to clear them.

How do I find the exact field names in my PDF form?

While in the form editing mode (like 'Prepare Form'), field names are usually displayed directly over the form elements. You can also double-click any field to open its Properties dialog, where the exact 'Name' is listed on the General tab.

Will this JavaScript autofill work on all PDF readers?

Advanced PDF JavaScript is fully supported in Adobe Acrobat and full-featured PDF editors. However, it may not function correctly in basic web browser PDF viewers or mobile previewers, so advise your users to download the file and open it in a dedicated desktop application.