Skip to main content
April 3, 2017
Question

Text Field Custom Calculation Script Won't Save/Stay Selected

  • April 3, 2017
  • 3 replies
  • 7381 views

I have a Text field named "MyField". I'd like to add a Custom Calculation Script to it. Every time I select the edit, enter the code, and then click OK, it does not save the code and then reselects the default "Value is not calculated" option. It will even happen in fields that I have already saved previously and that did once work. When returning to them sometimes, I will see the selection change from "Customer Calculation Script" to "Value is not calculated" as soon as I activate that Calculate tab. Does anyone have any idea what causes this and/or how to avoid/correct it. I have tried searching all over Google and can't seem to find anyone else that has brought up this issue.

3 replies

JR Boulay
Community Expert
Community Expert
March 29, 2025

[MOVED TO THE ACROBAT DISCUSSIONS]

Acrobate du PDF, InDesigner et Photoshopographe
try67
Community Expert
Community Expert
April 3, 2017

Yes, I've experienced it as well. Mostly when using one of the built-in functions for calculation/validation/keystroke/etc.

The code usually works, although it's not displayed in the window, though.

April 3, 2017

Yeah, I was hoping it would still work, but it doesn't seem to. It does appear to happen more often when I have multiple files open that share the same field names but are not actually connected... That is not *always* the case, though... I don't think.

Thom Parker
Community Expert
Community Expert
April 3, 2017

I've had the same thing happen before.

Are you using the default JS editor or an external editor? And does the doc contain a large number of related fields?

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
April 3, 2017

This is while in the form through the text field properties.

try67
Community Expert
Community Expert
April 3, 2017

Huh? This doesn't really answer any of the questions asked above...