Skip to main content
Known Participant
Mar 30, 2021 9:13 PM UTC
Question

Hide/Show fields not working on mobile devices

Hi

I have aline of code that works no problem on desktop. In custom keystroke script:

this.getField("Supply_App.3").display = (event.value=="None") ? display.hidden : display.visible;

 

This doens't work on a mobile device -I'm testing on an iPad with Acrobate Reader for iOS. I've read I shoudl replace the ? with an if statement but I'm struggling to get it to work correctly without adding an additoanl vaidation field - which I'd rather not do. Any advice?

TIA

This topic is closed to new replies. Start a new post to keep the conversation going.

5 replies

Thom Parker
Community Expert
Community Expert
Mar 30, 2021 9:48 PM UTC

Try using PDF Expert on the IPad.  Strangely it has a much better Acrobat JS implementation than Mobile Acrobat. 

Translate
Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
try67
Community Expert
Community Expert
Mar 30, 2021 9:21 PM UTC

I don't think it will make much of a difference, but you can give it a try:

 

if (event.value=="None") this.getField("Supply_App.3").display =  display.hidden;

else this.getField("Supply_App.3").display =  display.visible;

 

I would recommend trying it in PDF Expert by Readdle, which currently has the best support for scripts out of all mobile PDF apps.

Translate
Ang111Author
Known Participant
Mar 30, 2021 10:51 PM UTC

Thank you. As you thought, the code didn't help on ipad but PDF Expert works well so thank you! On a slightly seperate note, do you know how I can find out why my pdf keeps crashing? Only crashes on a laptop adn when I tab out of a specific field. I've deleted the field and added it back in but still have the same problem. I have opened another thread for that issue but thougth I'd try my luck here too 🙂  Thanks again

 

 

Translate
Thom Parker
Community Expert
Community Expert
Mar 31, 2021 12:54 AM UTC

Look in the Console window for any reported errors, Ctrl-J

 

Translate
Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often