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

Hide/Show fields not working on mobile devices

Community Beginner ,
Mar 30, 2021 Mar 30, 2021

Copy link to clipboard

Copied

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

TOPICS
Acrobat SDK and JavaScript

Views

140

Likes

Translate

Translate

Report

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 ,
Mar 30, 2021 Mar 30, 2021

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

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 Beginner ,
Mar 30, 2021 Mar 30, 2021

Copy link to clipboard

Copied

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

 

 

Likes

Translate

Translate

Report

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 ,
Mar 30, 2021 Mar 30, 2021

Copy link to clipboard

Copied

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

 

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

Likes

Translate

Translate

Report

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 Beginner ,
Mar 31, 2021 Mar 31, 2021

Copy link to clipboard

Copied

LATEST

Thanks Thom, I'm not seeing any error there. In fact at the moment it's only crashing when in Reader. I've attached a crash log but I have no idea how to interpret it. Any ideas how I can begin to fault find with this?

Likes

Translate

Translate

Report

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 ,
Mar 30, 2021 Mar 30, 2021

Copy link to clipboard

Copied

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

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

Likes

Translate

Translate

Report

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