Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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...
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
You must use "Prepare Form", not "Edit PDF".
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
When you use "Prepare Form" you are in the form editing mode.
Copy link to clipboard
Copied
What Bernd is saying is correct, and is what I suggested earlier.
Copy link to clipboard
Copied
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...
Copy link to clipboard
Copied
For this use the simplified field notation.
Copy link to clipboard
Copied
Thanks Bernd, unfortunately I'm not familiar with creating/editing Java Script
Copy link to clipboard
Copied
You don't need JavaScript for this.
Use something like this:
field1 - field2 + field3
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
What are the names of the fields?
Copy link to clipboard
Copied
As above, 76, 78 and 79...
Copy link to clipboard
Copied
Change the names to F76, F78, and so on
In the properties of F79 use the following simplified field notation:
F76 - F78
Copy link to clipboard
Copied
Awesome, thanks so much.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
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:
Open your form in Adobe Acrobat (Standard or Pro).
Go to the Prepare Form and select your fields.
Right-click the “Total” field, choose Properties, and go to the Calculate tab.
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
Copy link to clipboard
Copied
[MOVED TO THE ACROBAT DISCUSSIONS]
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more