Skip to main content
bastienr46119786
Participant
February 6, 2018
質問

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

  • February 6, 2018
  • 返信数 1.
  • 1018 ビュー

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 ?

このトピックへの返信は締め切られました。

返信数 1

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

No error is showing up when changing the value of dropdown and exiting the field.


The error messages I'm seeing are for the trim method. This method was introduced in a relatively late version of ECMAScript, so it's possible my version of Acrobat doesn't support it, while your does.