Skip to main content
Participating Frequently
July 14, 2016
Question

Auto-summing possible?

  • July 14, 2016
  • 4 replies
  • 2688 views

Is it possible to add numerical fields to a form that can auto-sum? For example, say I want to add 6 numerical fields/boxes to a form, then ask the user to input numbers into 5 of the fields, is there an option to direct the 6th box to be automatically populated with the total?

4 replies

JR Boulay
Community Expert
April 27, 2025

[MOVED TO THE ACROBAT DISCUSSIONS]

Acrobate du PDF, InDesigner et Photoshopographe
New Participant
April 23, 2025

I have a question on Auto-summing and figured this is a good place to ask.

Can I combine auto-summing with validation?  For example,  new customers need to spend a 2k hookup fee but existing customers do not.   I want to use auto-summing to calculate the hookup fee and grand total for new customers using text fields, but do not want it to calculate the 2k hookup fee for existing customers.   Is that possible?

Community Manager
April 28, 2025

Hi @jessica_0941,

 

Thank you for reaching out. As you know, this most likely can be achieved with  

 

To meet your requirement, where the total field should only calculate based on newly entered values and not on pre-existing values, a standard field calculation (sum of fields) would not be sufficient.

You would need to use a custom JavaScript inside the form to control when and how the sum is calculated.

 

Here’s a basic example of how you could achieve this:

  1. Open your form in Adobe Acrobat (Standard or Pro).

  2. Go to the Prepare Form and select your fields.

  3. Right-click the “Total” field, choose Properties, and go to the Calculate tab.

  4. Select Custom Calculation Script, and enter a script similar to this:

// Example script
var f1 = this.getField("Field1");
var f2 = this.getField("Field2");
var f3 = this.getField("Field3");

var sum = 0;

// Check if the field was newly filled (example logic: not pre-populated or modified)
if (!f1.isDefaultValue) sum += Number(f1.value);
if (!f2.isDefaultValue) sum += Number(f2.value);
if (!f3.isDefaultValue) sum += Number(f3.value);

event.value = sum;

 

Important:

  • isDefaultValue helps identify whether a field value has changed since the form was opened.

  • You can adjust the logic based on how you distinguish between “existing” and “new” data.

 

Alternatively, you can add a check box, and based on that, you can decide whether to pay this fee or not. 

 

 


~Tariq

Participating Frequently
July 15, 2016

Ah, understood! Have located the 'calculate' option! Just a final q, is it possible to minus values? Could only see options for plus and multiply...

Bernd Alheit
Community Expert
July 15, 2016

For this use the simplified field notation.

Bernd Alheit
Community Expert
July 15, 2016

As above, 76, 78 and 79...


Change the names to F76, F78, and so on

In the properties of F79 use the following simplified field notation:

F76 - F78

Inspiring
July 14, 2016

Sure. You can use the built-in method for adding field values on the Calculate tab of the field properties dialog for the 6th field that you want to auto-calculate. You'll also notice the simplified field notation and custom JavaScript options, which you may want or need to use.

Here's a link to a good tutorial: https://acrobatusers.com/tutorials/how-to-do-not-so-simple-form-calculations

Participating Frequently
July 14, 2016

Thank you, I don't seem to have a calculate tab in field properties? Only General, Appearance, Position and Options. Can't find any options for calculating at all? I'm using the Creative Cloud Acrobat DC...

Inspiring
July 14, 2016

You must have selected the "This document requires signatures" check box when you started creating the form. What you can do is go into form editing mode, click the "More" button in the right-hand pane, and select "Revert to Acrobat Form". This will make it a regular Acroform that allows custom calculations. If you really need this to work with the Adobe Sign service, then you won't be able to use automatic calculations.