Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

- Home
- Acrobat SDK
- Discussions
- Re: JavaScript calculations delayed?

- Re: JavaScript calculations delayed?

/t5/acrobat-sdk-discussions/javascript-calculations-delayed/td-p/9842957
May 22, 2018
May 22, 2018

Copy link to clipboard

Copied

I have a form that I made through Adobe Acrobat. The second page on this document is basically a giant calculator. I see that my java script is correct and the calculations are correct, but there is somewhat of a delay when it calculates. That is the only way I can explain it. Basically what happens, is I go down my rows and when I have the total calculate everything for me, its off a little. But if I leave it alone and start typing somewhere else, it correct itself. Almost like it didn't fully calculate and was delayed. I don't know if this is a glitch with Adobe Acrobat or if it's something I did wrong. I can't imagine I am doing something wrong because if I use "the value is..." calculation, I get the same thing.

I have a link below to the document if anybody wants to see what I am talking about. It is really weird. The sheet isn't completely done, so go to the second page, and try the section to the right.

https://www.dropbox.com/s/r3f8a69t7i57p3y/Composition%20Job%20Package%20updated%205-18-2018.pdf?dl=0

Any help on this would be greatly appreciated. I feel like I am going crazy with this since I don't know if it's the software or me.

TOPICS

Acrobat SDK and JavaScript
,
Windows

Community guidelines

Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

Adobe Community Professional
,
May 22, 2018
May 22, 2018

What you describe is caused by the wrong "field calculation order" - that's the order in which fields are getting calculated. You need to arrange the fields so that fields that rely on other fields are getting calculated after the "source fields" are calculated. You can modify the calculation order in Acrobat's form editing mode:

6
Replies
6

/t5/acrobat-sdk-discussions/javascript-calculations-delayed/m-p/9842958#M21868
May 22, 2018
May 22, 2018

Copy link to clipboard

Copied

Community guidelines

Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

chriss59216024
AUTHOR

New Here
,

/t5/acrobat-sdk-discussions/javascript-calculations-delayed/m-p/9842959#M21869
May 22, 2018
May 22, 2018

Copy link to clipboard

Copied

I dont see that on my end.

I have adobe Acrobat PRO. Is it maybe located somewhere else?

Community guidelines

Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

/t5/acrobat-sdk-discussions/javascript-calculations-delayed/m-p/9842960#M21870
May 22, 2018
May 22, 2018

Copy link to clipboard

Copied

Community guidelines

chriss59216024
AUTHOR

New Here
,

/t5/acrobat-sdk-discussions/javascript-calculations-delayed/m-p/9842961#M21871
May 22, 2018
May 22, 2018

Copy link to clipboard

Copied

Community guidelines

/t5/acrobat-sdk-discussions/javascript-calculations-delayed/m-p/9842962#M21872
May 23, 2018
May 23, 2018

Copy link to clipboard

Copied

Any time your form changes, all fields that have a calculation scrip will receive the "calculate" event. That's why you see all these fields in the list. Let's say you have the following fields:

A and B are entered by the user

C and D are entered by the user

E is calculated as the sum of A and B

F is calculated as the sum of C and D

G is calculated as the sum of E and F

In this case, you have three calculated fields: E, F and G. Because G is using both E and F in it's calculation, you have to make sure that E and F are getting calculated before G gets calculated. Because E and F do not depend on each other, it does not matter if you end up with E F G or F E G - as long as G gets calculated after E and F the form will behave correctly.

You will have to analyze your form to see what fields depend on what other fields and then reflect that in your field calculation order.

Community guidelines

chriss59216024
AUTHOR

New Here
,

LATEST
/t5/acrobat-sdk-discussions/javascript-calculations-delayed/m-p/9842963#M21873
May 24, 2018
May 24, 2018

Copy link to clipboard

Copied

I think I got it. I did a portion, and seems to run smooth. That you for all your help.

Community guidelines

Using the Community
Experience League
Terms of Use
Privacy Policy
Cookie preferences
AdChoices
Language:

- Deutsch
- English
- Español
- Français
- 日本語コミュニティ
- Português

Copyright © 2021 Adobe. All rights reserved.