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

How to create subtraction calculation function in Acrobat DC?

New Here ,
Jul 29, 2020 Jul 29, 2020

Hi,

I need to create a function to find the difference between the values of 2 cells in each particular row in my interactive form. 

The names of the two cells are 'From1' and 'To1'.

Under the calculation function, the functions available are only limited to sum, product, average, max, min.

I tried to use the simplified field notation by entering the following statement:

From1 - To1

I achieved no success.

Appreciate if someone can help me on this.

Thank you

TOPICS
PDF forms
1.1K
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 29, 2020 Jul 29, 2020

That should have worked. You will need to change the value of one of the fields for it to "kick in", though.

If it still doesn't work check the JS Console (Ctrl+J) for error messages.

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 29, 2020 Jul 29, 2020

If you just want to show difference between 2 fields in 3rd field you can try this as custom calculation script in 3rd field.( rename the names of the fields in code if needed)

var a = this.getField("From1").value;
var b = this.getField("To1").value;
if (a > b || a == b){
this.getField("Difference").value = a-b;
}
if (a < b){
this.getField("Difference").value = b-a;
}

 

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 29, 2020 Jul 29, 2020
LATEST

1. Be sure that From1 and To1 uses the "Number" format.

 

2. In simplified notation, if ever fields names uses dots or blank spaces they must be escaped with a backslash:

From\.1 - To\ 1


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