Skip to main content
Known Participant
March 30, 2021
Question

Hide/Show fields not working on mobile devices

  • March 30, 2021
  • 2 replies
  • 1132 views

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 has been closed for replies.

2 replies

Thom Parker
Community Expert
Community Expert
March 30, 2021

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

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
try67
Community Expert
Community Expert
March 30, 2021

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.

Ang111Author
Known Participant
March 30, 2021

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

 

 

Thom Parker
Community Expert
Community Expert
March 31, 2021

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

 

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