PDF Editing Issues

Populate an Adobe Acrobat Form Field from a Yes or No Selection

Amos GikundaAmos Gikunda Nov 18, 2026 870 views

Question details

Automatically populate a Final Score field based on a Yes or No selection in an Acrobat form.

Populate an Adobe Acrobat Form Field from a Yes or No Selection
Product
Adobe Acrobat
Device & OS
not provided
Scenario
A form contains an Overall Score, a Yes or No answer, and a Final Score field.
Observed behavior
The desired Final Score is 1 when Yes is selected and the Overall Score when No is selected.
Before you start

Open the PDF in Adobe Acrobat and select All tools > Prepare a form. Confirm that the form has an Overall Score field, a Yes or No radio-button group or drop-down, and a Final Score text field.

Solution 1Recommended

Add a custom calculation to the Final Score field

Use an Acrobat JavaScript calculation to return 1 for Yes and copy Overall Score for No.

1
Set the answer export values

In Prepare a form, open the properties of the Yes and No radio buttons or the drop-down field. On the Options tab, set the corresponding export values to yes and no. For radio buttons, use the same field name for both choices and a different choice value for each.

2
Open the calculation editor

Double-click the Final Score text field, select the Calculate tab, choose Custom calculation script, and click Edit.

3
Enter the script

Paste this script into the editor and replace the field names with the exact names used in your form: var score = this.getField("Overall Score").value; var answer = this.getField("Answer Question").valueAsString; if (answer == "yes") { event.value = 1; } else if (answer == "no") { event.value = score; } else { event.value = ""; }

4
Check the calculation order

If Overall Score is itself calculated, use More > Set Field Calculation Order in Prepare a form and place Overall Score before Final Score.

5
Save and test the form

Save the PDF, enter a numeric Overall Score, and select Yes and then No. Verify that Final Score shows 1 for Yes and the Overall Score for No; with no answer selected, it should be blank.

Add a custom calculation to the Final Score field
Check field names and values: Field names and export values must match the script exactly. The visible option labels can differ from their export values. Use a PDF viewer that supports Acrobat form JavaScript when testing the saved form.
Free Microsoft Office alternative

Work with office documents and PDFs in WPS Office

WPS Office is a free, lightweight alternative for working with office documents and PDFs. Its familiar interface and Microsoft Office format compatibility make it easy to move existing files into WPS. Use Adobe Acrobat for the custom form calculation described above; WPS is not a replacement for that Acrobat scripting workflow.

Open and fill compatible PDF formsWork with Microsoft Word, Excel, and PowerPoint formatsUse a familiar interface for everyday document tasksGet a free, lightweight office suite
microsoft office alternative - wps office

Frequently Asked Questions

Why doesn't the Final Score change when I select Yes or No?

In Prepare a form, check that the answer field name matches the script and that its Options tab uses the export values yes and no. Also test the PDF in a viewer that supports Acrobat form JavaScript.

Can I use a drop-down instead of radio buttons?

Yes. In the drop-down field's Options tab, assign yes and no as the export values for the two items. The same calculation script can read the drop-down field.

What happens if no answer is selected?

The script sets Final Score to a blank value when the answer is neither yes nor no.

Why is Final Score showing an old Overall Score?

If Overall Score is calculated, open Prepare a form > More > Set Field Calculation Order and move Overall Score before Final Score. Then test the selections again.