PDF Editing Issues

Count Matching Drop-Down Selections in an Adobe Acrobat Form

Olivia MillerOlivia Miller Nov 19, 2026 868 views

Question details

Count how many of 15 drop-down fields contain a specific option and display the result in a text field.

Count Matching Drop-Down Selections in an Adobe Acrobat Form
Product
Adobe Acrobat
Device & OS
not provided
Scenario
A PDF form has 15 drop-down fields and needs a separate text field to show the count for a selected option.
Observed behavior
The result field should update to show the number of drop-down fields whose committed value matches the specified option.
Before you start

Open the PDF in an Acrobat edition that lets you edit form fields, and check the field names and the option's export value. The example below assumes the fields are named Dropdown1 through Dropdown15.

Solution 1Recommended

Add a Custom Calculation Script to the Result Field

Use this method to count an exact value across 15 Acrobat drop-down fields and display the total in a text field.

The script compares each field's value as a string. If an option has an export value, use that value in the comparison rather than assuming the visible label is used.

1
Open the form editor

Open the PDF in Acrobat and select All tools > Prepare a form, or Tools > Prepare Form in older versions.

2
Check the drop-down fields

Open each drop-down field's Properties and check its name and option values. Use Dropdown1 through Dropdown15 for the example, or adjust the script to match your field names.

3
Open the result field calculation

Add or select the text field that will display the count. Open its Properties, select the Calculate tab, and choose Custom calculation script > Edit.

4
Enter the script

In the JavaScript editor, enter the following script and replace A with the value to count: var total = 0; for (var i = 1; i <= 15; i++) { if (this.getField("Dropdown" + i).valueAsString == "A") total++; } event.value = total;

5
Commit selections immediately

For each drop-down field, open Properties > Options and select Commit selected value immediately. Save the PDF, exit form editing, and test several selections.

Add a Custom Calculation Script to the Result Field
Count other options: For each additional option, add a separate result text field and use the same script with A replaced by that option's value.
Free Microsoft Office alternative

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. It supports common Microsoft Office formats for easier migration, but it does not replace Acrobat's custom form calculation setup.

Open and view PDF forms alongside office documentsCompatible with Microsoft Word, Excel, and PowerPoint formatsFamiliar interface for moving between documents, spreadsheets, and presentationsFree, lightweight office suite for everyday tasks
microsoft office alternative - wps office

Frequently Asked Questions

Why does the count stay at zero even when an option is selected?

Check each drop-down's Properties > Options for its export value. The script must compare against the stored value, which may differ from the visible option label. Also verify that the field names match the script.

How can I make the count update as soon as a selection changes?

In Prepare a form, open each drop-down field's Properties > Options and select Commit selected value immediately. Then test the form outside the editing view.

Can I count a different number of drop-down fields?

Yes. In the custom calculation script, change the loop limit from 15 to the number of consecutively named fields, and make sure the field-name prefix matches your form.

How do I show separate counts for several options?

Create one result text field for each option. In each field's Properties > Calculate > Custom calculation script, use the same loop and replace A with the corresponding option value.