Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
It does contain "AF", actually, in these strings:
"Ventilation - HAF (Units: No)", "HU-Ventilation - HAF (Units: No)",
Copy link to clipboard
Copied
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.
Use the Acrobat JavaScript Reference early and often
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
It's a pretty straight forward case statement. No AF or other obvious Acrobat internal function calls.
It is indeed odd.
Use the Acrobat JavaScript Reference early and often
Copy link to clipboard
Copied
It does contain "AF", actually, in these strings:
"Ventilation - HAF (Units: No)", "HU-Ventilation - HAF (Units: No)",
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Use the Acrobat JavaScript Reference early and often
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Please tell me how to check these hidden code
Copy link to clipboard
Copied
You can't do it from within Acrobat. I've attached it as a text file.
Copy link to clipboard
Copied
At the internal you can following script:
Copy link to clipboard
Copied
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.

