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

Can't save Javascript in PDF form

Community Beginner ,
Apr 21, 2020 Apr 21, 2020

Copy link to clipboard

Copied

I have a simple Javascript that calculates the number of checked checkboxes. But after saving the file all javascripts are lost. I tried to lock, did not use the previews and did many other actions and nothing helps. What I do wrong?

UPD. Thank you all. I cancelled my plan on Adobe, because as I can understand, none can help me and technical support on Adobe does not work for non-standart cases. I will try to do my project with other tools.

TOPICS
General troubleshooting , PDF forms

Views

2.3K

Translate

Translate

Report

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 ,
Apr 21, 2020 Apr 21, 2020

Copy link to clipboard

Copied

Hi,

Can you confirm the version of the software and operating system you are using?

Also, can you indicate were you are saving this document? It is possible that some protection service, like an antivirus, is trying to keep your PDFs 'clean' as it might feel your additional code could be malicious.

Votes

Translate

Translate

Report

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 Beginner ,
Apr 21, 2020 Apr 21, 2020

Copy link to clipboard

Copied

Thank you for the reply!

I think I have the latest version of the Acrobat DC

Architecture: x86_64

Build: 20.6.20042.371807

AGM: 4.30.98

CoolType: 5.14.5

JP2K: 1.2.2.45402

My OS is macOS mojave 10.14.5 and I'm trying to save in the Documents folder. I have no antivirus as I know...

I'm on my free tryal week before the buying the SW, cuold it be the root of the problem?

Votes

Translate

Translate

Report

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 ,
Apr 21, 2020 Apr 21, 2020

Copy link to clipboard

Copied

What code does you use?

Votes

Translate

Translate

Report

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 Beginner ,
Apr 21, 2020 Apr 21, 2020

Copy link to clipboard

Copied

var nSum = 0;

var aCkFlds = this.getField("CheckBox1").getArray();

 

for(var i=0;i<aCkFlds.length;i++){

  if(aCkFlds[i].isBoxChecked(0))nSum++;

}

 

event.value = nSum;

Votes

Translate

Translate

Report

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 ,
Apr 21, 2020 Apr 21, 2020

Copy link to clipboard

Copied

Acrobat DC on Windows doesn't remove the code.

Votes

Translate

Translate

Report

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 Beginner ,
Apr 21, 2020 Apr 21, 2020

Copy link to clipboard

Copied

Same for my developer computer, but the saved file still does not work on smartphones and macs

Votes

Translate

Translate

Report

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 ,
Apr 21, 2020 Apr 21, 2020

Copy link to clipboard

Copied

How are you saving it, exactly? It should not cause any code to be removed.

Votes

Translate

Translate

Report

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 Beginner ,
Apr 21, 2020 Apr 21, 2020

Copy link to clipboard

Copied

Just in very ordinary way, Save-as

I'd made the short screen video, all the interface is in Russian, but all functions are the same

https://youtu.be/2w2k0dY8ENA

 

Votes

Translate

Translate

Report

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 ,
Apr 21, 2020 Apr 21, 2020

Copy link to clipboard

Copied

Try this:

Delete the field and re-create the field with the script.

Votes

Translate

Translate

Report

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 Beginner ,
Apr 22, 2020 Apr 22, 2020

Copy link to clipboard

Copied

Does not work.

Votes

Translate

Translate

Report

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 Beginner ,
Apr 22, 2020 Apr 22, 2020

Copy link to clipboard

Copied

It does not work

Votes

Translate

Translate

Report

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 ,
Apr 22, 2020 Apr 22, 2020

Copy link to clipboard

Copied

Where in the video does you save the filled form?

Votes

Translate

Translate

Report

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 Beginner ,
Apr 22, 2020 Apr 22, 2020

Copy link to clipboard

Copied

File - Save As - Choose the folder - Save

 

and tryed another way

File - Save as Other - Reader Extended PDF - Enable more tools (incl form fill-in and save) - Save now - Save

Votes

Translate

Translate

Report

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 ,
Apr 22, 2020 Apr 22, 2020

Copy link to clipboard

Copied

Don't fill the form in Apple Preview, it will damage the form.

Votes

Translate

Translate

Report

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 Beginner ,
Apr 23, 2020 Apr 23, 2020

Copy link to clipboard

Copied

LATEST

I have read your answer on the same topic. If I dont use any previews and even open the file after saving, it looses scripts anyway.

Votes

Translate

Translate

Report

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 ,
Apr 22, 2020 Apr 22, 2020

Copy link to clipboard

Copied

You're exporting the PDF to another PDF using the Adobe PDF virtual printer... That is like sending it to an actual printer, so of course all the fields, scripts, etc. will be gone. Why are you doing that?

Votes

Translate

Translate

Report

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 Beginner ,
Apr 22, 2020 Apr 22, 2020

Copy link to clipboard

Copied

How to do it right, that is the question 😉 

This way does not help too

Снимок экрана 2020-04-23 в 9.02.55.png

Is there another way to make pdf form with scripts?

Votes

Translate

Translate

Report

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