PDF Editing Issues

Use an Adobe Acrobat Checkbox to Fill PDF Fields with N/A

John WilsonJohn Wilson Nov 25, 2026 868 views

Question details

The user wants a PDF form checkbox to insert N/A into several fields when selected and clear them when deselected.

Use an Adobe Acrobat Checkbox to Fill PDF Fields with N/A
Product
Adobe Acrobat
Device & OS
not provided
Scenario
A PDF form has multiple text fields that can be marked not applicable using one checkbox.
Observed behavior
Selecting the checkbox should set the designated fields to N/A; deselecting it should clear them.
Before you start

Open the PDF in a version of Adobe Acrobat that supports editing form fields, and check the exact names of the text fields in Prepare a Form. The script below replaces existing values in those fields and clears them when the checkbox is deselected.

Solution 1Recommended

Add a Mouse Up JavaScript action to the checkbox

Use this method to control several named text fields from one Acrobat form checkbox.

1
Open the form editor

In Adobe Acrobat, open the PDF and choose All tools > Prepare a form. Add a checkbox if the form does not already have one.

2
Open checkbox actions

Right-click the checkbox, select Properties, and open the Actions tab. Set Select Trigger to Mouse Up and Select Action to Run a JavaScript, then click Add.

3
Enter the script

Paste the following script into the JavaScript editor, replacing Text1, Text2, and Text3 with the exact names of your form fields: if (event.target.value == "Off") { this.getField("Text1").value = ""; this.getField("Text2").value = ""; this.getField("Text3").value = ""; } else { this.getField("Text1").value = "N/A"; this.getField("Text2").value = "N/A"; this.getField("Text3").value = "N/A"; }

4
Save and test the form

Click OK to save the action, close the checkbox properties, and save the PDF. Exit form editing or use Preview, then select and deselect the checkbox to verify that the fields fill and clear.

Add a Mouse Up JavaScript action to the checkbox
Existing entries are replaced: This script sets every listed field to N/A, even if it already contains text. Deselecting the checkbox clears those fields rather than restoring their previous values. The PDF viewer must also support and allow Acrobat JavaScript.
Free Microsoft Office alternative

Work with PDF and Office files in WPS Office

WPS Office is a free, lightweight alternative with a familiar interface for working with PDF and Microsoft Office files. It can help you work with existing documents, but it does not replace the Acrobat JavaScript setup described above; check your PDF viewer’s script support before distributing the form.

Open and work with PDF documents alongside office files.Compatible with Microsoft Word, Excel, and PowerPoint formats, including DOCX, XLSX, and PPTX.A familiar interface makes moving from Microsoft Office straightforward.Free, lightweight office tools are available; some advanced features may require a subscription.
microsoft office alternative - wps office

Frequently Asked Questions

How do I find the names of the PDF text fields?

In Acrobat, choose All tools > Prepare a form, then open a field’s Properties and check its name on the General tab. Use that exact name in each getField call.

Will the script leave existing field entries untouched?

No. Selecting the checkbox replaces the contents of every listed field with N/A, and deselecting it clears those fields. Use a different script if existing entries must be preserved.

Why does the checkbox work in Acrobat but not in another PDF viewer?

The other viewer may not support Acrobat JavaScript or may have JavaScript disabled. Test the saved form in each viewer your recipients will use.

Can I control more than three fields with the checkbox?

Yes. In the checkbox’s Mouse Up JavaScript action, add a getField line for each additional field in both branches: set it to an empty string in the Off branch and to N/A in the other branch.