Other PDF Issues

How to Create Payment Method Subtotals in an Acrobat PDF Form

Emma BrownEmma Brown Oct 28, 2026 869 views

Question details

The user wants to calculate and display separate subtotals for different payment methods (e.g., cash, credit card, check) within a fillable PDF sales form.

How to Create Payment Method Subtotals in an Acrobat Form
Product
Adobe Acrobat
Device & OS
not provided
Scenario
Designing a fillable PDF sales or invoice form that processes multiple transactions and categorizes totals based on how the customer paid.
Observed behavior
The form needs to automatically evaluate the selected payment method for each row and sum the corresponding transaction amounts into dedicated subtotal fields.
Before you start

Ensure you have Adobe Acrobat Pro or an advanced PDF editor installed, as basic PDF readers do not support creating or editing JavaScript calculations in form fields.

Solution 1Recommended

Use Custom JavaScript to Calculate Subtotals by Payment Type

Create custom JavaScript code within your subtotal fields to evaluate each row's payment method dropdown and add the corresponding amount to the specific total.

Acrobat's built-in sum function cannot filter by categories. To calculate subtotals based on a condition (like payment method), you must use a custom JavaScript calculation script that loops through your form fields.

1
Enable Prepare Form Mode

Launch Adobe Acrobat, go to the Tools menu, and select 'Prepare Form'. This will make all your form fields editable and display the field properties.

2
Standardize Your Field Names

Ensure your transaction rows have consistent, numbered field names. For example, name the payment dropdowns 'PayMethod1', 'PayMethod2' and the amounts 'Amount1', 'Amount2'.

3
Create Subtotal Fields

Add separate text fields for each payment type at the bottom of your form, naming them appropriately, such as 'Subtotal_Cash' and 'Subtotal_Credit'.

4
Add the Custom Calculation Script

Right-click the 'Subtotal_Cash' field, select Properties, and go to the Calculate tab. Select 'Custom calculation script' and click Edit. Write a JavaScript loop that iterates through your rows, checks if 'PayMethod' equals 'Cash', and if true, adds the 'Amount' to the running total. Repeat this process for the other subtotal fields.

Use Custom JavaScript to Calculate Subtotals by Payment Type
Script Maintenance: Consistent field naming makes your JavaScript loop much simpler to write. If you use a standard naming convention, you can use a simple 'for' loop to iterate through the field numbers.

Easily Manage and Fill Advanced PDF Forms with WPS Office

While advanced form creation requires specific design tools, WPS Office provides a comprehensive PDF toolkit that allows you to seamlessly view, fill, edit, and sign interactive PDF forms without expensive software subscriptions.

  1. 1. Open WPS Office: Launch the WPS Office application on your computer or mobile device and click on the 'PDF' tab.
  2. 2. Load Your PDF Form: Click 'Open' to browse your files and select the fillable PDF sales or invoice form you want to complete.
  3. 3. Fill in the Data: Click directly on the interactive fields, dropdowns, and checkboxes to input your transaction amounts and select payment methods.
  4. 4. Save and Share: Once the form is filled out, click 'Save' to preserve the data or use the share feature to send the completed PDF form via email.
Fully compatible with standard interactive PDF forms and Adobe Acrobat files.Lightweight and fast PDF reading, editing, and form-filling experience.Easily input data into text fields, dropdowns, and checkboxes on desktop and mobile.Completely free to download and use for essential office tasks.
microsoft office alternative - wps office

Frequently Asked Questions

Why aren't my PDF form calculation scripts working?

Ensure JavaScript is enabled in your PDF reader's preferences. Additionally, double-check that your field names in the form exactly match the variable names referenced in your JavaScript code, as they are case-sensitive.

Will these JavaScript calculations work on mobile devices?

JavaScript support on mobile PDF readers is often limited. Complex form calculations might not execute properly on basic mobile viewer apps, so it is recommended to fill complex calculated forms on a desktop PDF editor.

Can I export the calculated PDF form data to Excel?

Yes, advanced PDF editors allow you to export form data to CSV or Excel formats, which is highly useful for further financial analysis, accounting, and record-keeping.