PDF Editing Issues

Use Acrobat JavaScript to Update PDF Checkboxes from a Dropdown

Emma BrownEmma Brown Nov 25, 2026 870 views

Question details

Connect a marital-status dropdown to three PDF form checkboxes and optionally update the dropdown when a checkbox is selected.

Use Acrobat JavaScript to Update PDF Checkboxes from a Dropdown
Product
Adobe Acrobat Pro PDF forms
Device & OS
not provided
Scenario
A PDF form has a marital-status dropdown and separate Married, Single, and Divorced checkboxes.
Observed behavior
Selecting a dropdown value should check the matching box and clear the others; Widowed and Widow should select Single.
Before you start

Open the form in Adobe Acrobat Pro and use All tools > Prepare a form to check the exact field names and confirm that the three controls are checkboxes, not radio buttons. The scripts below assume one widget per checkbox and dropdown values that match the labels shown.

Solution 1Recommended

Update the checkboxes from the dropdown

Use a dropdown validation script to select the matching checkbox and clear the others.

1
Open the dropdown properties

In All tools > Prepare a form, right-click the marital-status dropdown, choose Properties, and open the Validate tab.

2
Add the validation script

Select Run custom validation script and click Edit. Paste the following script, replacing the field names with the exact names in your form: var v = event.value; this.getField("Married").checkThisBox(0, v === "Married"); this.getField("Single").checkThisBox(0, v === "Single" || v === "Widowed" || v === "Widow"); this.getField("Divorced").checkThisBox(0, v === "Divorced");

3
Test each option

Close the properties dialog and use Preview to select each dropdown option. Confirm that Married, Single, and Divorced select their respective boxes, and that Widowed and Widow select Single.

4
Check script errors

If a selection does not work, open the JavaScript console with Ctrl+J on Windows and check for errors. Verify the field names, dropdown export values, and checkbox type in Prepare a form.

Update the checkboxes from the dropdown
Match the stored values: The script compares the dropdown's stored values, which may differ from its displayed labels. Adjust the comparisons if the options use different export values. An unmatched value clears all three checkboxes.
Free Microsoft Office alternative

Work with PDF forms and Office files in WPS Office

WPS Office is a free, lightweight alternative with a familiar interface for working with PDFs and Office documents. Use it to view and fill PDF forms and continue working with existing Office files; creating or troubleshooting Acrobat form JavaScript requires a compatible PDF form editor.

View and fill PDF forms in a familiar workspaceOpen and edit Microsoft Word, Excel, and PowerPoint formats, including DOCX, XLSX, and PPTXMove between PDF and Office documents in one applicationGet started with a free, lightweight office suite
microsoft office alternative - wps office

Frequently Asked Questions

Where should I put the dropdown JavaScript in Acrobat?

In Prepare a form, open the dropdown's Properties > Validate, select Run custom validation script, and click Edit.

Why does Widowed not select the Single checkbox?

Check the dropdown option's stored export value in Properties > Options. The script must compare event.value with that exact value, not necessarily the displayed label.

What does the zero in checkThisBox(0, true) mean?

It identifies the first widget in the checkbox field. The examples assume each named checkbox has one widget; a field with multiple widgets may require a different index.

Can I use the same script for radio buttons?

First confirm the control type in Prepare a form. Radio-button groups have different field and export-value arrangements, so their selection logic may need to be adapted rather than copied unchanged.

Will every PDF viewer run the form JavaScript?

No. JavaScript support varies by viewer and settings. Test the completed form in the PDF applications your recipients will use, including Acrobat or Acrobat Reader.