PDF Editing Issues

Fix Checkbox and Radio Button Form Logic in Adobe Acrobat

Natalie TaylorNatalie Taylor Nov 19, 2026 868 views

Question details

The user needs a Notes field to appear only when a checkbox is unchecked and a radio button is set to No.

Fix Checkbox and Radio Button Form Logic in Adobe Acrobat
Product
Adobe Acrobat
Device & OS
not provided
Scenario
A PDF form uses JavaScript to control the visibility of a Notes field based on checkbox and radio button selections.
Observed behavior
The current script unexpectedly changes the radio button value instead of only checking its selection.
Before you start

Open the PDF in Acrobat and use Prepare a form to check the exact field names and the radio button's export value. The example below assumes the checkbox is named Checkbox, the radio field is Choice.1, and the Notes field is named Notes.

Solution 1Recommended

Correct the comparison and update the Notes field visibility

Use a comparison operator to check the radio selection without assigning a new value.

A single equals sign assigns a value. Replace `this.getField("Choice.1").value = "No"` with `this.getField("Choice.1").value === "No"` to compare the existing value instead.

1
Open the form actions

In Acrobat, open Prepare a form, right-click the checkbox, and select Properties. On the Actions tab, find the existing Run a JavaScript action and select Edit.

2
Update the visibility logic

Replace the relevant logic with: `var checked = this.getField("Checkbox").valueAsString !== "Off"; var choice = this.getField("Choice.1").valueAsString; this.getField("Notes").display = (!checked && choice === "No") ? display.visible : display.hidden;` Replace the field names and `No` with the actual names and export value in your form.

3
Apply the action to the radio buttons

In each radio button's Properties > Actions tab, add or update a Mouse Up action using Run a JavaScript with the same visibility logic, so changing either control can update Notes.

4
Test the selections

Select Preview in Prepare a form. Check that Notes is hidden when the checkbox is checked, visible when it is unchecked and the radio value is No, and hidden for other radio selections.

Correct the comparison and update the Notes field visibility
Check the export value: A radio button's visible label may differ from its export value. Use the value configured in the radio button's Properties, not necessarily the text displayed beside it.
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 Office files and PDFs. Its format compatibility makes moving everyday documents easier, but it is not a replacement for editing or testing Acrobat-specific JavaScript form logic.

Open and view PDF forms alongside other documentsWork with Microsoft Word, Excel, and PowerPoint formatsUse a familiar interface for everyday document tasksMove existing Office documents into a lightweight workspace
microsoft office alternative - wps office

Frequently Asked Questions

Why does the radio button change to No when the script runs?

The expression `value = "No"` assigns No to the field. Use `value === "No"` to compare the existing value without changing it.

How do I find the radio button value to compare?

In Acrobat's Prepare a form tool, open the radio button's Properties and check its export value. Compare the script against that value, which may differ from the visible label.

When should the Notes field be visible?

With the logic shown, Notes is visible only when the checkbox value is Off and the radio field's value is No. It is hidden in all other combinations.

Where do I add the JavaScript so both controls update Notes?

In Prepare a form, open Properties > Actions for the checkbox and each radio button. Add or edit a Mouse Up action using Run a JavaScript, then test all combinations in Preview.