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

Ghost JavaScript

Community Expert ,
Jan 14, 2021 Jan 14, 2021

Bonjour et bonne année

 

I need to understand.

A client sent me this form made with Acrobat Pro, in which there is a drop-down menu, in which there is a JavaScript acting on the boxes located below, and it works very well.

 

The problem is that this JavaScript script does not appear anywhere, neither in the Actions of the field, nor in "all JavaScripts", etc.

If we try to add another action in this drop-down list, it deletes the existing script.

And if you deactivate JavaScript in the Preferences it no longer works.

 

The client assures me that this file was made like the others which do not pose this problem and that it has not undergone any particular treatment.

 

Is this a known bug or is it brand new?

 

The culprit file is here: https://documentcloud.adobe.com/link/track?uri=urn:aaid:scds:US:17536fea-de12-4d2a-a825-dca3fe66db9d


Acrobate du PDF, InDesigner et Photoshoptographe
TOPICS
JavaScript , PDF forms
542
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 ,
Jan 14, 2021 Jan 14, 2021

This is a kind of bug in Acrobat. The code is located under the Keystroke event of the drop-down field but because it contains a string ("AF") that Acrobat considers to be an indicator that an internal, undocumented function is used, it doesn't display it. If you examine the file using a PDF debugger tool you'll see that it's there. Here's the full code:

 

 

if (!event.willCommit) {
if (event.changeEx  =="A Renseigner") {
this.getField("Text61.0.0").fillColor = color.black;
this.getField("Text61.0.1").fillColor = color.black;
this.getField("Text61.0.2").fillColor = color.black;
this.getField("Text61.0.3").fillColor = color.black;
this.getField("Text61.0.4").fillColor = color.black;
this.getField("Text61.1.0").fillColor = color.black;
this.getField("Text61.1.1").fillColor = color.black;
this.getField("Text61.1.2").fillColor = color.black;
this.getField("Text61.1.3").fillColor = color.black;
this.getField("Text61.1.4").fillColor = color.black;
this.getField("Text61.0.0").readonly = true;
this.getField("Text61.0.1").readonly = true;
this.getField("Text61.0.2").readonly = true;
this.getField("Text61.0.3").readonly = true;
this.getField("Text61.0.4").readonly = true;
this.getField("Text61.1.0").readonly = true;
this.getField("Text61.1.1").readonly = true;
this.getField("Text61.1.2").readonly = true;
this.getField("Text61.1.3").readonly = true;
this.getField("Text61.1.4").readonly = true;
}

else if (event.changeEx  == "DAF 800") {
this.getField("Text61.0.0").fillColor = color.transparent;
this.getField("Text61.0.1").fillColor = color.transparent;
this.getField("Text61.0.2").fillColor = color.black;
this.getField("Text61.0.3").fillColor = color.black;
this.getField("Text61.0.4").fillColor = color.black;
this.getField("Text61.1.0").fillColor = color.transparent;
this.getField("Text61.1.1").fillColor = color.transparent;
this.getField("Text61.1.2").fillColor = color.black;
this.getField("Text61.1.3").fillColor = color.black;
this.getField("Text61.1.4").fillColor = color.black;
this.getField("Text61.0.0").readonly = false;
this.getField("Text61.0.1").readonly = false;
this.getField("Text61.0.2").readonly = true;
this.getField("Text61.0.3").readonly = true;
this.getField("Text61.0.4").readonly = true;
this.getField("Text61.1.0").readonly = false;
this.getField("Text61.1.1").readonly = false;
this.getField("Text61.1.2").readonly = true;
this.getField("Text61.1.3").readonly = true;
this.getField("Text61.1.4").readonly = true;
}


else if (event.changeEx=="DAF 1200"){
this.getField("Text61.0.0").fillColor = color.transparent;
this.getField("Text61.0.1").fillColor = color.transparent;
this.getField("Text61.0.2").fillColor = color.transparent;
this.getField("Text61.0.3").fillColor = color.black;
this.getField("Text61.0.4").fillColor = color.black;
this.getField("Text61.1.0").fillColor = color.transparent;
this.getField("Text61.1.1").fillColor = color.transparent;
this.getField("Text61.1.2").fillColor = color.transparent;
this.getField("Text61.1.3").fillColor = color.black;
this.getField("Text61.1.4").fillColor = color.black;
this.getField("Text61.0.0").readonly = false;
this.getField("Text61.0.1").readonly = false;
this.getField("Text61.0.2").readonly = false;
this.getField("Text61.0.3").readonly = true;
this.getField("Text61.0.4").readonly = true;
this.getField("Text61.1.0").readonly = false;
this.getField("Text61.1.1").readonly = false;
this.getField("Text61.1.2").readonly = false;
this.getField("Text61.1.3").readonly = true;
this.getField("Text61.1.4").readonly = true;
}

else if (event.changeEx=="DAF 1600"){
this.getField("Text61.0.0").fillColor = color.transparent;
this.getField("Text61.0.1").fillColor = color.transparent;
this.getField("Text61.0.2").fillColor = color.transparent;
this.getField("Text61.0.3").fillColor = color.transparent;
this.getField("Text61.0.4").fillColor = color.black;
this.getField("Text61.1.0").fillColor = color.transparent;
this.getField("Text61.1.1").fillColor = color.transparent;
this.getField("Text61.1.2").fillColor = color.transparent;
this.getField("Text61.1.3").fillColor = color.transparent;
this.getField("Text61.1.4").fillColor = color.black;
this.getField("Text61.0.0").readonly = false;
this.getField("Text61.0.1").readonly = false;
this.getField("Text61.0.2").readonly = false;
this.getField("Text61.0.3").readonly = false;
this.getField("Text61.0.4").readonly = true;
this.getField("Text61.1.0").readonly = false;
this.getField("Text61.1.1").readonly = false;
this.getField("Text61.1.2").readonly = false;
this.getField("Text61.1.3").readonly = false;
this.getField("Text61.1.4").readonly = true;
}


else if (event.changeEx== "DAF 2000") {
this.getField("Text61.0.0").fillColor = color.transparent;
this.getField("Text61.0.1").fillColor = color.transparent;
this.getField("Text61.0.2").fillColor = color.transparent;
this.getField("Text61.0.3").fillColor = color.transparent;
this.getField("Text61.0.4").fillColor = color.transparent;
this.getField("Text61.1.0").fillColor = color.transparent;
this.getField("Text61.1.1").fillColor = color.transparent;
this.getField("Text61.1.2").fillColor = color.transparent;
this.getField("Text61.1.3").fillColor = color.transparent;
this.getField("Text61.1.4").fillColor = color.transparent;
this.getField("Text61.0.0").readonly = false;
this.getField("Text61.0.1").readonly = false;
this.getField("Text61.0.2").readonly = false;
this.getField("Text61.0.3").readonly = false;
this.getField("Text61.0.4").readonly = false;
this.getField("Text61.1.0").readonly = false;
this.getField("Text61.1.1").readonly = false;
this.getField("Text61.1.2").readonly = false;
this.getField("Text61.1.3").readonly = false;
this.getField("Text61.1.4").readonly = false;
}

else {
this.getField("Text61.0.0").fillColor = color.transparent;
this.getField("Text61.0.1").fillColor = color.transparent;
this.getField("Text61.0.2").fillColor = color.transparent;
this.getField("Text61.0.3").fillColor = color.transparent;
this.getField("Text61.0.4").fillColor = color.transparent;
this.getField("Text61.1.0").fillColor = color.transparent;
this.getField("Text61.1.1").fillColor = color.transparent;
this.getField("Text61.1.2").fillColor = color.transparent;
this.getField("Text61.1.3").fillColor = color.transparent;
this.getField("Text61.1.4").fillColor = color.transparent;
this.getField("Text61.0.0").readonly = false;
this.getField("Text61.0.1").readonly = false;
this.getField("Text61.0.2").readonly = false;
this.getField("Text61.0.3").readonly = false;
this.getField("Text61.0.4").readonly = false;
this.getField("Text61.1.0").readonly = false;
this.getField("Text61.1.1").readonly = false;
this.getField("Text61.1.2").readonly = false;
this.getField("Text61.1.3").readonly = false;
this.getField("Text61.1.4").readonly = false;
}
}

 

 

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 ,
Jan 14, 2021 Jan 14, 2021

What script does you use in the form?

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 ,
Jan 14, 2021 Jan 14, 2021

This is a kind of bug in Acrobat. The code is located under the Keystroke event of the drop-down field but because it contains a string ("AF") that Acrobat considers to be an indicator that an internal, undocumented function is used, it doesn't display it. If you examine the file using a PDF debugger tool you'll see that it's there. Here's the full code:

 

 

if (!event.willCommit) {
if (event.changeEx  =="A Renseigner") {
this.getField("Text61.0.0").fillColor = color.black;
this.getField("Text61.0.1").fillColor = color.black;
this.getField("Text61.0.2").fillColor = color.black;
this.getField("Text61.0.3").fillColor = color.black;
this.getField("Text61.0.4").fillColor = color.black;
this.getField("Text61.1.0").fillColor = color.black;
this.getField("Text61.1.1").fillColor = color.black;
this.getField("Text61.1.2").fillColor = color.black;
this.getField("Text61.1.3").fillColor = color.black;
this.getField("Text61.1.4").fillColor = color.black;
this.getField("Text61.0.0").readonly = true;
this.getField("Text61.0.1").readonly = true;
this.getField("Text61.0.2").readonly = true;
this.getField("Text61.0.3").readonly = true;
this.getField("Text61.0.4").readonly = true;
this.getField("Text61.1.0").readonly = true;
this.getField("Text61.1.1").readonly = true;
this.getField("Text61.1.2").readonly = true;
this.getField("Text61.1.3").readonly = true;
this.getField("Text61.1.4").readonly = true;
}

else if (event.changeEx  == "DAF 800") {
this.getField("Text61.0.0").fillColor = color.transparent;
this.getField("Text61.0.1").fillColor = color.transparent;
this.getField("Text61.0.2").fillColor = color.black;
this.getField("Text61.0.3").fillColor = color.black;
this.getField("Text61.0.4").fillColor = color.black;
this.getField("Text61.1.0").fillColor = color.transparent;
this.getField("Text61.1.1").fillColor = color.transparent;
this.getField("Text61.1.2").fillColor = color.black;
this.getField("Text61.1.3").fillColor = color.black;
this.getField("Text61.1.4").fillColor = color.black;
this.getField("Text61.0.0").readonly = false;
this.getField("Text61.0.1").readonly = false;
this.getField("Text61.0.2").readonly = true;
this.getField("Text61.0.3").readonly = true;
this.getField("Text61.0.4").readonly = true;
this.getField("Text61.1.0").readonly = false;
this.getField("Text61.1.1").readonly = false;
this.getField("Text61.1.2").readonly = true;
this.getField("Text61.1.3").readonly = true;
this.getField("Text61.1.4").readonly = true;
}


else if (event.changeEx=="DAF 1200"){
this.getField("Text61.0.0").fillColor = color.transparent;
this.getField("Text61.0.1").fillColor = color.transparent;
this.getField("Text61.0.2").fillColor = color.transparent;
this.getField("Text61.0.3").fillColor = color.black;
this.getField("Text61.0.4").fillColor = color.black;
this.getField("Text61.1.0").fillColor = color.transparent;
this.getField("Text61.1.1").fillColor = color.transparent;
this.getField("Text61.1.2").fillColor = color.transparent;
this.getField("Text61.1.3").fillColor = color.black;
this.getField("Text61.1.4").fillColor = color.black;
this.getField("Text61.0.0").readonly = false;
this.getField("Text61.0.1").readonly = false;
this.getField("Text61.0.2").readonly = false;
this.getField("Text61.0.3").readonly = true;
this.getField("Text61.0.4").readonly = true;
this.getField("Text61.1.0").readonly = false;
this.getField("Text61.1.1").readonly = false;
this.getField("Text61.1.2").readonly = false;
this.getField("Text61.1.3").readonly = true;
this.getField("Text61.1.4").readonly = true;
}

else if (event.changeEx=="DAF 1600"){
this.getField("Text61.0.0").fillColor = color.transparent;
this.getField("Text61.0.1").fillColor = color.transparent;
this.getField("Text61.0.2").fillColor = color.transparent;
this.getField("Text61.0.3").fillColor = color.transparent;
this.getField("Text61.0.4").fillColor = color.black;
this.getField("Text61.1.0").fillColor = color.transparent;
this.getField("Text61.1.1").fillColor = color.transparent;
this.getField("Text61.1.2").fillColor = color.transparent;
this.getField("Text61.1.3").fillColor = color.transparent;
this.getField("Text61.1.4").fillColor = color.black;
this.getField("Text61.0.0").readonly = false;
this.getField("Text61.0.1").readonly = false;
this.getField("Text61.0.2").readonly = false;
this.getField("Text61.0.3").readonly = false;
this.getField("Text61.0.4").readonly = true;
this.getField("Text61.1.0").readonly = false;
this.getField("Text61.1.1").readonly = false;
this.getField("Text61.1.2").readonly = false;
this.getField("Text61.1.3").readonly = false;
this.getField("Text61.1.4").readonly = true;
}


else if (event.changeEx== "DAF 2000") {
this.getField("Text61.0.0").fillColor = color.transparent;
this.getField("Text61.0.1").fillColor = color.transparent;
this.getField("Text61.0.2").fillColor = color.transparent;
this.getField("Text61.0.3").fillColor = color.transparent;
this.getField("Text61.0.4").fillColor = color.transparent;
this.getField("Text61.1.0").fillColor = color.transparent;
this.getField("Text61.1.1").fillColor = color.transparent;
this.getField("Text61.1.2").fillColor = color.transparent;
this.getField("Text61.1.3").fillColor = color.transparent;
this.getField("Text61.1.4").fillColor = color.transparent;
this.getField("Text61.0.0").readonly = false;
this.getField("Text61.0.1").readonly = false;
this.getField("Text61.0.2").readonly = false;
this.getField("Text61.0.3").readonly = false;
this.getField("Text61.0.4").readonly = false;
this.getField("Text61.1.0").readonly = false;
this.getField("Text61.1.1").readonly = false;
this.getField("Text61.1.2").readonly = false;
this.getField("Text61.1.3").readonly = false;
this.getField("Text61.1.4").readonly = false;
}

else {
this.getField("Text61.0.0").fillColor = color.transparent;
this.getField("Text61.0.1").fillColor = color.transparent;
this.getField("Text61.0.2").fillColor = color.transparent;
this.getField("Text61.0.3").fillColor = color.transparent;
this.getField("Text61.0.4").fillColor = color.transparent;
this.getField("Text61.1.0").fillColor = color.transparent;
this.getField("Text61.1.1").fillColor = color.transparent;
this.getField("Text61.1.2").fillColor = color.transparent;
this.getField("Text61.1.3").fillColor = color.transparent;
this.getField("Text61.1.4").fillColor = color.transparent;
this.getField("Text61.0.0").readonly = false;
this.getField("Text61.0.1").readonly = false;
this.getField("Text61.0.2").readonly = false;
this.getField("Text61.0.3").readonly = false;
this.getField("Text61.0.4").readonly = false;
this.getField("Text61.1.0").readonly = false;
this.getField("Text61.1.1").readonly = false;
this.getField("Text61.1.2").readonly = false;
this.getField("Text61.1.3").readonly = false;
this.getField("Text61.1.4").readonly = false;
}
}

 

 

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 ,
Jan 14, 2021 Jan 14, 2021
LATEST

Thank you!

You make my day.


Acrobate du PDF, InDesigner et Photoshoptographe
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