PDF Editing Issues

Add Checkbox Values to a Total Field in Adobe Acrobat

Chanuka GeekiyanageChanuka Geekiyanage Nov 19, 2026 869 views

Question details

Calculate a total from the numeric values assigned to eight checkboxes in a PDF form.

Add Checkbox Values to a Total Field in Adobe Acrobat
Product
Adobe Acrobat
Device & OS
not provided
Scenario
A form creator wants a total field to update as users select or clear checkboxes.
Observed behavior
The total field should add the values of selected checkboxes and exclude cleared checkboxes.
Before you start

Open the PDF in an Acrobat edition that supports editing form fields, and make sure you can access Prepare a Form. Decide on a unique name and numeric value for each of the eight checkboxes.

Solution 1Recommended

Use a custom calculation script to add checkbox values

Assign numeric export values to the checkboxes, then calculate their sum in a text field.

1
Open the form editor

In Acrobat, open the PDF and select All tools > Prepare a form. In some versions, the entry point is Tools > Prepare Form.

2
Name the checkboxes

Open each checkbox's Properties and give it a unique name, such as Check1 through Check8. If you use different names, update the script in the calculation step to match.

3
Set numeric export values

In each checkbox's Properties, open the Options tab and enter its numeric value in Export Value, such as 10 or 25. A cleared checkbox has the value Off and will not contribute to the total.

4
Add the total field

In Prepare a form, add a text field for the total or open the Properties of an existing text field. On the Calculate tab, select Custom calculation script and click Edit.

5
Enter the calculation

Paste this script in the editor, then save it and close the field properties: var total = 0; for (var i = 1; i <= 8; i++) { var f = this.getField('Check' + i); if (f.value !== 'Off') total += Number(f.value); } event.value = total;

6
Test the form

Select Preview in Prepare a form, then select and clear several checkboxes. Confirm that the total changes accordingly, and save the PDF.

Use a custom calculation script to add checkbox values
Check field names and values: The example expects fields named Check1 through Check8 and numeric export values. If your names differ, change the field references in the script; nonnumeric export values can produce an invalid total.
Free Microsoft Office alternative

Work with PDFs and Office files in WPS Office

WPS Office is a free, lightweight alternative for working with PDFs and Office documents. Its familiar interface and format compatibility make it easy to move between everyday files. Use Acrobat for the custom checkbox calculation described above.

Open and work with PDF documents alongside other office filesCompatible with Microsoft Office formats including DOCX, XLSX, and PPTXFamiliar interface for a smoother transition from OfficeFree, lightweight tools for everyday document work
QA img-9

Frequently Asked Questions

Where do I set a checkbox's numeric value in Acrobat?

Open the PDF in Prepare a form, open the checkbox's Properties, and enter a number in Export Value on the Options tab.

Why does the script need unique checkbox names?

The script retrieves each field by name using this.getField. Give the checkboxes distinct names in their Properties and make sure those names match the script.

What happens when a checkbox is cleared?

A cleared checkbox has the value Off. The script checks for Off and excludes that checkbox from the total.

Why is the total not calculating correctly?

In Prepare a form, check that every field name matches the script and that each Export Value is numeric. Then use Preview to test the fields; also check Acrobat's JavaScript preferences if scripts are disabled.