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

Strange Connected Dropdown with no Javascript

New Here ,
Nov 25, 2023 Nov 25, 2023

I have a PDF with two dropdown and both are connected somehow.
If you select any value from first dropdown then based on that a list of values will be inserted into second 

dropdown to select from.
I have checked everying, there is no javascript in both dropdown and there is also no document level javascript in the pdf file.
Can anyone tell me how this is working ?

I am attaching the PDF, Please have a look
Thanks for your help

TOPICS
How to , JavaScript , PDF , PDF forms
2.1K
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
2 ACCEPTED SOLUTIONS
Community Expert ,
Nov 26, 2023 Nov 26, 2023

Acrobat hides some scripts it considers to use "internal" code. This usually happens when they contain the string "AF" in them, but there might be other reasons, too.

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 ,
Nov 27, 2023 Nov 27, 2023

It does contain "AF", actually, in these strings:

 

"Ventilation - HAF (Units: No)", "HU-Ventilation - HAF (Units: No)",

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 ,
Nov 25, 2023 Nov 25, 2023

There 's a keystroke (i.e. commit) script .  For some reason it's not being shown.  Very Odd. The Dropdown also a field property that shouldn't have been set for a combobox.  But I don't think that has any affect. 

Whatever application built this PDF (and it's not Acrobat) did something screwy. 

 

 

 

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

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 ,
Nov 26, 2023 Nov 26, 2023

Acrobat hides some scripts it considers to use "internal" code. This usually happens when they contain the string "AF" in them, but there might be other reasons, too.

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 ,
Nov 26, 2023 Nov 26, 2023

It's a pretty straight forward case statement.  No AF or other obvious Acrobat internal function calls. 

It is indeed odd.

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

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 ,
Nov 27, 2023 Nov 27, 2023

It does contain "AF", actually, in these strings:

 

"Ventilation - HAF (Units: No)", "HU-Ventilation - HAF (Units: No)",

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 ,
Nov 27, 2023 Nov 27, 2023

Just to test it out I removed those two items from the code and re-applied it to the Keystroke event and it didn't disappear.

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 ,
Nov 27, 2023 Nov 27, 2023

Too funny, I saw those and discounted them since the "AF" is part of another word and in a quoted string. 

That's just sad.  I'm surprised scripts aren't disappearing in lots of forms. 

 

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

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 ,
Nov 27, 2023 Nov 27, 2023
LATEST

The code is analyzed as a string, probably using a RegExp. And it appears to be case-sensitive, which is why it doesn't happen that often, only when "AF" appears in it. I agree it's very bad and near-sighted programming.

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 ,
Nov 27, 2023 Nov 27, 2023

Please tell me how to check these hidden code

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 ,
Nov 27, 2023 Nov 27, 2023

You can't do it from within Acrobat. I've attached it as a text file.

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 ,
Nov 26, 2023 Nov 26, 2023

At the internal you can following script:

Bild9.jpgexpand image

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 ,
Nov 27, 2023 Nov 27, 2023

To solve this bug of Acrobat move the code to a function in a doc-level script and call it from there, instead of putting it directly under the field's action.

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