Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Auto-summing possible?

New Here ,
Jul 14, 2016 Jul 14, 2016

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?

TOPICS
PDF forms
2.9K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 14, 2016 Jul 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 14, 2016 Jul 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...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 14, 2016 Jul 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 15, 2016 Jul 15, 2016

Thanks for your response, I don't think I selected that check box at the start. Anyhow, I went into PDF edit mode and clicked 'more'. Only options available were:

-Background (add, update, remove)

-Bates Numbering (add, remove)

-Add Bookmark

-Attach File

-Add Article Box

I tried creating a new form, ensuring the 'requires signature' was not selected, and the same options were available.

Any other suggestions on why I am missing the calculations tab?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 15, 2016 Jul 15, 2016

You must use "Prepare Form", not "Edit PDF".

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 15, 2016 Jul 15, 2016

I was in 'prepare form' mode originally, but George suggested I needed to access a 'revert to acrobat form' mode via the 'edit pdf' tool first. My problem is that I do not seem to have the calculate tab within properties when preparing the form.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 15, 2016 Jul 15, 2016

When you use "Prepare Form" you are in the form editing mode.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 15, 2016 Jul 15, 2016

What Bernd is saying is correct, and is what I suggested earlier.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 15, 2016 Jul 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...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 15, 2016 Jul 15, 2016

For this use the simplified field notation.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 15, 2016 Jul 15, 2016

Thanks Bernd, unfortunately I'm not familiar with creating/editing Java Script

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 15, 2016 Jul 15, 2016

You don't need JavaScript for this.

Use something like this:

field1 - field2 + field3

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 15, 2016 Jul 15, 2016

The box it takes you to is titled 'Create and Edit Javascrpits'.

I just want field named 79 to be the total of the value in field 76 minus the value in field 78.

I had already tried some sums...

field76-field78=field79

field76 - field78 = field79 (with spaces)

field76-field78 (without equals)

76-78=79 (without 'field')

76-78.... and so on.

Does anyone one know the exact format the calculation should be entered?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 15, 2016 Jul 15, 2016

What are the names of the fields?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 15, 2016 Jul 15, 2016

As above, 76, 78 and 79...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 15, 2016 Jul 15, 2016

Change the names to F76, F78, and so on

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

F76 - F78

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 15, 2016 Jul 15, 2016

Awesome, thanks so much.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 15, 2016 Jul 15, 2016

Simplified field notation does not require one to write JavaScript but has some requirements for field names.

All field names must start with an alphabetical character.

There can be no spaces or other special characters with then field name. If there are you must use the JavaScript escape character to precede this character so it is treated as a character and not a parsing break.

Mathematical operations are kept the to four arithmetic operands.

You can not use any field's property or method.

JavaScript conditional statements cannot be used.

The simplified field notation is used to pass field values, operands, and constants to a JavaScript backend function.

More information is available in Acrobat's help.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 23, 2025 Apr 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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Apr 28, 2025 Apr 28, 2025
LATEST

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 27, 2025 Apr 27, 2025

[MOVED TO THE ACROBAT DISCUSSIONS]


Acrobate du PDF, InDesigner et Photoshopographe
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines