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

JavaScript calculations delayed?

New Here ,
May 22, 2018 May 22, 2018

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
2.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

correct answers 1 Correct answer

Community Expert , 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:

2018-05-22_15-03-37.png

Translate
Community Expert ,
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:

2018-05-22_15-03-37.png

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 ,
May 22, 2018 May 22, 2018

I dont see that on my end.

ddsd.jpg

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

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 ,
May 22, 2018 May 22, 2018

Actually, you have Adobe Acrobat XI Pro - my screenshot was from the current version Acrobat DC. The "Pro" is not what makes the difference, it's the XI vs. DC. You can find the field order control under the "Other Tasks" menu.

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 ,
May 22, 2018 May 22, 2018

Got it. So this is odd, but I see every single field that is involved in a calculation. Does this mean Adobe is reading them all together? Is there anyway to separate sections if that is the case? If it isn't the case, how should I put them in order?

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 ,
May 23, 2018 May 23, 2018

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.

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 ,
May 24, 2018 May 24, 2018
LATEST

I think I got it. I did a portion, and seems to run smooth. That you for all your 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