Skip to main content
New Participant
March 31, 2024
Question

Subtraction in Simplified Notation keeps subtracting when inputting other field

  • March 31, 2024
  • 2 replies
  • 603 views

I used a simplified notation:

 

Field 1= E17-K19

Field 2= K19

Field 3= E21-K23

Field 4= K23

 

and when I input all the other fields, Field 1 and Field 3 just keeps subtracting from the amount minus from fields 2 & 4 respectively. How can I stop them from subtracting repetitively while I input data from other fields? I just want them to subtract once. Is there a problem on my set calculation order?

 

Please help me. Thank you! Adobe acrobat

This topic has been closed for replies.

2 replies

Thom Parker
Community Expert
March 31, 2024

You need to provide complete information when posting questions. 

In this case, how are Field 1-3 related to the "E" and "K" fields?  

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
New Participant
March 31, 2024

E17=   -> (in Simplified Notation) E17-K19 

K19=  ->K19

E21=  -> (in Simplified Notation) E21-K23

K23=  -> K23

 

I am sorry for the confusion.

How can I stop them from subtracting repetitively while I input data from other fields? I just want them to subtract once. Is there a problem on my set calculation order?

Thom Parker
Community Expert
March 31, 2024

Yes, there is a huge problem with the calculations.  

Lets walk through the sequence of actions for the E17 calculations.

1. User enters the value 3 into K19.

2. This triggers the calculation script on E17.

3. At this point lets say that E17 is 0, so the result is -3. 

4. Now the user clicks on a checkbox somewhere else on the form.

5. This also triggers the calculation script on E17.

6. Since E17 is -3, the new result is -6.

7. Repeat steps 5 and 6 everytime any field on the form is changed. 

 

    

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
Bernd Alheit
Community Expert
March 31, 2024

Looks like your other issue.