PDF Editing Issues

Highlight Unselected Yes and No PDF Checkboxes in Adobe Acrobat

Natalie TaylorNatalie Taylor Nov 19, 2026 870 views

Question details

Highlight a pair of mutually exclusive Yes and No checkboxes when neither option is selected.

Highlight Unselected Yes and No PDF Checkboxes in Adobe Acrobat
Product
Adobe Acrobat
Device & OS
not provided
Scenario
A PDF form has a Yes and No question that should be visually flagged when left unanswered.
Observed behavior
Both checkboxes should have a yellow background when unchecked and return to their normal background when an option is selected.
Before you start

Open the form in Adobe Acrobat and use Prepare a Form to check the exact names of the Yes and No checkbox widgets. Confirm that the form already makes the two choices mutually exclusive; the highlighting script does not enforce exclusivity.

Solution 1Recommended

Add a Mouse Up script to both checkbox widgets

Use Acrobat JavaScript to update both checkbox backgrounds whenever the user clicks either option.

1
Open the form editor

Open the PDF in Acrobat and choose All tools > Prepare a form. Select each checkbox and open Properties to verify its field or widget name.

2
Add the script to Yes

Open the Yes checkbox Properties, select Actions, choose Mouse Up as the trigger and Run a JavaScript as the action, then select Add. Enter the script below, replacing both example names with the names in your form: var yes = this.getField("pg2_Q1.Check1.0"); var no = this.getField("pg2_Q1.Check1.1"); if (yes && no) { var neitherSelected = yes.value === "Off" && no.value === "Off"; yes.fillColor = neitherSelected ? color.yellow : color.white; no.fillColor = neitherSelected ? color.yellow : color.white; }

3
Add the script to No

Open the No checkbox Properties and add the same script under Actions > Mouse Up > Run a JavaScript. Both fields need the action so either click updates the pair.

4
Save and test

Save the PDF and exit Prepare a form. Click each checkbox and then clear the selection: both backgrounds should be yellow only when both values are Off.

Add a Mouse Up script to both checkbox widgets
When the highlight appears: The Mouse Up action runs after a checkbox is clicked; it does not automatically highlight untouched fields when the PDF opens. The script restores a white background, so change color.white if the fields use another normal background color.
Free Microsoft Office alternative

Use WPS Office for everyday PDF and document work

WPS Office is a free, lightweight alternative with a familiar interface for working with PDFs and Office documents. It can help with general PDF tasks and moving between compatible file formats, but it does not replace Acrobat for adding or testing this checkbox JavaScript.

Open PDF forms alongside your other documentsWork with Microsoft Office formats such as DOCX, XLSX, and PPTXUse familiar editing tools for an easier transition from Microsoft OfficeKeep common document tools together in a lightweight suite
microsoft office alternative - wps office

Frequently Asked Questions

Why does the script check for Off instead of Yes or No?

Acrobat checkbox fields use Off when unchecked. Checking whether both values are Off identifies the unanswered state without depending on the selected export values.

Does the script prevent both checkboxes from being selected?

No. It only changes their background colors. Configure the form to make the choices mutually exclusive, or use a radio-button group for a single-choice question.

Why are untouched checkboxes not yellow when I open the PDF?

A Mouse Up action runs only when its checkbox is clicked. To flag untouched questions, run equivalent validation from a separate form action, such as a review button.

Why might the highlight not work in another PDF viewer?

Some PDF viewers do not support Acrobat JavaScript or may have JavaScript disabled. Test the saved form in Acrobat or Acrobat Reader with JavaScript enabled.