PDF Editing Issues

Select Acrobat Radio Buttons Automatically Based on a Score

Phi Hung VoPhi Hung Vo Nov 18, 2026 869 views

Question details

Automatically select one of five radio buttons according to a numeric total in a fillable PDF.

Select Acrobat Radio Buttons Automatically Based on a Score
Product
Adobe Acrobat
Device & OS
not provided
Scenario
A PDF form has a calculated total and five score categories, from below 50 to 80 or higher.
Observed behavior
The desired result is for the radio button corresponding to the total's score range to be selected automatically.
Before you start

In Acrobat, open Prepare a form and check the total field's calculation and the radio buttons' field names. Confirm the score boundaries and, for a shared radio group, each button's export value.

Solution 1Recommended

Select Separate Radio Fields with a Custom Calculation Script

Use this approach when each score category is a separate radio field, as in the original example.

The example uses fields E, D, C, B, and A for scores below 50, 50–59, 60–69, 70–79, and 80 or higher. Replace these names and boundaries with your form's actual settings.

If the total already has a custom calculation script, place the selection code after the statement that sets event.value. If it uses a built-in calculation, switching to a custom script requires reproducing that calculation first.

1
Open the total field properties

In Acrobat, choose All tools > Prepare a form, then double-click the total field and open the Calculate tab.

2
Edit the calculation script

Select Custom calculation script and click Edit. After the code that calculates event.value, add: var raw = event.value; var valid = raw !== null && String(raw).replace(/\s/g, '') !== '' && isFinite(Number(raw)); var score = Number(raw); this.getField('E').checkThisBox(0, valid && score < 50); this.getField('D').checkThisBox(0, valid && score >= 50 && score < 60); this.getField('C').checkThisBox(0, valid && score >= 60 && score < 70); this.getField('B').checkThisBox(0, valid && score >= 70 && score < 80); this.getField('A').checkThisBox(0, valid && score >= 80);

3
Save and test the form

Click OK to close the script editor and field properties, then use Preview to enter scores around each boundary, such as 49, 50, 60, 70, and 80. Save the PDF when the expected buttons are selected.

Select Separate Radio Fields with a Custom Calculation Script
Field names must match: The script assumes each named field contains one radio button at index 0. If the buttons share one field name, use the radio-group method instead.
Free Microsoft Office alternative

Work with PDF and Office Files in WPS Office

WPS Office is a free, lightweight alternative for everyday PDF and Office document work. Its familiar interface and format compatibility make it easy to move existing files into your workflow. Use Acrobat to configure and test the Acrobat-specific JavaScript in this guide.

Open and work with PDF documents alongside Office filesCompatible with Microsoft Word, Excel, and PowerPoint formatsFamiliar interface for a straightforward transition from Microsoft OfficeFree, lightweight tools for everyday document work
microsoft office alternative - wps office

Frequently Asked Questions

Where do I add the score-based JavaScript in Acrobat?

In All tools > Prepare a form, open the total field's Properties, select the Calculate tab, and edit its custom calculation script. Add the radio selection code after the total is assigned to event.value.

What if my radio buttons all have the same field name?

Treat them as one radio group. In Prepare a form, check each button's export value, then set the group's value to the export value that corresponds to the score.

Will adding a custom script preserve my existing total calculation?

If the field already uses a custom calculation, keep its calculation code before the selection code. If it uses a built-in calculation, reproduce that calculation in the custom script before assigning the radio button.

How can I check that the score ranges work?

In Prepare a form, select Preview and enter values at and just below each boundary. For the example ranges, test values such as 49, 50, 59, 60, 69, 70, 79, and 80.