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

Calculation Scripts not saving

Explorer ,
Aug 07, 2017 Aug 07, 2017

I am creating my first form using Adobe Acrobat Pro.  I have researched my scripts and think I found the right one.  But it does not seem to be saving.  As soon as I type it in and click "OK", it disappears.  When I got back to edit it, the properties have defaulted to "this field is not calculated".  What do I need to do to fix this?

TOPICS
PDF forms
5.9K
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
1 ACCEPTED SOLUTION
Community Expert ,
Aug 08, 2017 Aug 08, 2017

You can use the notepad editor. It is part of MS Windows.

View solution in original post

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 ,
Aug 07, 2017 Aug 07, 2017

Can you add a new field and enter the script there?

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
Explorer ,
Aug 07, 2017 Aug 07, 2017

I've tried to do that and it still did not save.  It is almost like a have an "always default to 'This field not calculated' setting.

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 ,
Aug 07, 2017 Aug 07, 2017

Did you press the OK button at the bottom?

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
Explorer ,
Aug 07, 2017 Aug 07, 2017

Yes.  And that is when my script disappears and the radio button immediately goes back to "This field not calculated".

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 ,
Aug 07, 2017 Aug 07, 2017

Try adding following simple script:

var a = 1;

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
Explorer ,
Aug 07, 2017 Aug 07, 2017

Same thing happens.  It is as if I enter nothing at all into the

"Custom calculation script:", "Edit", "Create and Edit JaveScripts" field.

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 ,
Aug 07, 2017 Aug 07, 2017

Nâo quero mais receber esses arquivos

Enviado pelo meu Windows Phone

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 ,
Aug 07, 2017 Aug 07, 2017

Delete the field. Save the file. Close the file. Open the file. Add a new field (maybe with a different name). Try adding the calculation script again.

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
Explorer ,
Aug 07, 2017 Aug 07, 2017

I tried as you suggested.  Same thing.  Clears as soon as I hit OK and goes back to "Value is not calculated".  Do I have to do something to enable this?

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 ,
Aug 07, 2017 Aug 07, 2017

Sounds like the file is corrupt... Did you by any chance enter the code via Edit All JavaScripts? If so, you shouldn't have. That can cause serious issues, which are not easily solved later on.

One last thing you can try is to apply it using a script, like this:

this.getField("NameOfField").setAction("Calculate", "Enter your code here");

Run this command from the JS Console and then see if that works.

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
Explorer ,
Aug 07, 2017 Aug 07, 2017

This is the one and only script I have attempted.  This is my first form created from an excel file initially.  It is not going well.  I've not tried this on two different files.  I even tried creating a new file from the raw excel and I have the same issues.  It bothers me that I am trying to add a "text field" and then telling it to calculate something.  But I don't see any other options for fields like this.

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 ,
Aug 08, 2017 Aug 08, 2017

Try this:

In the category JavaScript of the preferences use an external JavaScript editor.

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
Explorer ,
Aug 08, 2017 Aug 08, 2017
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
Explorer ,
Aug 08, 2017 Aug 08, 2017

At the page level I can add a java script.  At the field level I still can't.  I don't understand why.

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 ,
Aug 08, 2017 Aug 08, 2017

Did you try an external JavaScript editor?

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
Explorer ,
Aug 08, 2017 Aug 08, 2017

Bernd.  Sorry, I did not.  That goes beyond my understanding (I am not a programmer - my last programming class was decades ago!) and I am not allowed to download anything to my company computer.

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 ,
Aug 08, 2017 Aug 08, 2017

You can use the notepad editor. It is part of MS Windows.

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
Explorer ,
Aug 08, 2017 Aug 08, 2017

That worked!  Hats off to you!!!!!!  Now to test my scripts.

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
Explorer ,
Oct 28, 2022 Oct 28, 2022
LATEST

I am havig the exact same issue, except my code is in the All JavaScripts area - not associated with any specific filderin terms of placement. I have been copying and pastung the code written by my developer across multiple forms. Works fine - unti now. Have the code is already thre. I just need to paste in a missing section. I get it from a form I know is working correctly. I paste it at the end of the existing code. I click OK, NOTHING activates the Save button. I modify a random field name to force save to be avaiable, repeat copy/paste - NOTHING in my Java gets saved. I paste Jave into Notes (i'm on a Macbook Pro) Copy it out from that plain text, repeate steps - NADA. 

I need help!! Thank you. (I am also NOT a coder.)

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