Skip to main content
bastienr46119786
Participant
February 6, 2018
Question

Text field value is correct only when cursor is inside text field. (Custom Calculation Script)

  • February 6, 2018
  • 1 reply
  • 1018 views

I use Acrobat Pro DC 18

I have a text field that show the last 3 digits of a select field value (using custom script).

The problem is that it only shows up the 3 digits when the cursor of the mouse is inside the text field. When it's outside, the value is not updated.

If I changed the select box value, the value is correct in the text field.

I fill out the pdf with PDFTK, I added this javascript when opening document so the calculations are triggered :

this.calculateNow();this.calculateNow();

Other fields work just fine. In another field I sum up this value and other fields value and the total is correct. Only the display is not correct for this field.

1. Cursor outside : value is not correct

2. Cursor inside : value is correct

3. Cursor outside : value is not correct

4. Changing value : value is correct :

It works on google chrome pdf viewer. :

Why the display value is not the same as its value ?

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
February 6, 2018

Without seeing the file it's very hard to say what's causing this issue.

Can you share the file with us (via Dropbox, Google Drive, Adobe Cloud, etc.)?

bastienr46119786
Participant
February 6, 2018

Thank you for your time.

Here is the document, the calculation is on page 3 :

test.pdf - Google Drive

try67
Community Expert
Community Expert
February 6, 2018

There are multiple errors in your JS code. Check the JS Console.