Set Acrobat Form Text Based on Radio Button Values
Question details
Set a PDF form's rating text according to a calculated score, with an override for three specific radio-button selections.

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- A form calculates a score and displays a potential rating based on that score and three radio-button groups.
- Observed behavior
- The rating should always display “Grow With Role” when all three specified selections have an export value of 1, regardless of the score.
In Acrobat's Prepare a Form tool, check the exact field names and export values of the three radio-button options. Confirm that the Score field calculates a numeric value before the rating field is evaluated.
Add an override to the rating field's calculation script
Check the three selected radio-button values before applying the score-based rating thresholds.
Open the PDF in Acrobat, choose All tools > Prepare a form, and open Properties for the text field that displays the potential rating.
On the Calculate tab, select Custom calculation script and click Edit. Enter: var ad = this.getField("Advancement Drive").valueAsString; var de = this.getField("Drive to Excel").valueAsString; var dc = this.getField("Development Commitment").valueAsString; var sum = Number(this.getField("Score").valueAsString); if (ad == "AD1" && de == "DE1" && dc == "DC1") { event.value = "Grow With Role"; } else if (sum <= 17) { event.value = "Grow With Role"; } else if (sum <= 22) { event.value = "Promotable"; } else if (sum >= 23) { event.value = "High Potential"; } else { event.value = ""; }
In the script editor, replace the example field names and AD1, DE1, and DC1 with the exact names and export values used in your form. If all three selected options use the export value 1, compare each value with "1" instead.
In Prepare a Form, use Set Field Calculation Order to place Score before the rating field. Save the PDF, then select the three special options and test both a low and a high score; also test other selections against the score thresholds.

Work with PDFs and Office files in WPS Office
WPS Office is a free, lightweight alternative with a familiar interface for working with Office documents and PDFs. Its format compatibility helps you move existing files into your workflow, but it does not replace Acrobat's form calculation scripting.

Frequently Asked Questions
Where do I find a radio button's export value?
In Acrobat's Prepare a Form tool, open the radio button's Properties and check the export or choice value on the Options tab. Use that exact value in the script.
Why does the special rating need to be checked first?
JavaScript evaluates the conditions in order. Placing the three-radio-button condition first ensures that “Grow With Role” overrides the score-based thresholds.
What if the rating uses an old score?
In Prepare a Form, open Set Field Calculation Order and ensure that the Score field is calculated before the rating field. Then test the form again.
Can the script use the value 1 for all three radio buttons?
Yes. If the selected option in each radio-button group has the export value 1, compare each field's valueAsString with "1" instead of the example values AD1, DE1, and DC1.




