A working show/hide field function for iPad

Hi,

I have created a pdf form where I need to hide five text fields using a checkbox. Everything works well on a computer. But we are using iPads to fill the form. And when trying this on the iPAD everything works great except the hiding function?

The function I'm using looks like this

getField("fieldhide").display = event.target.value === "Off" ? display.hidden : display.visible;


Christian Andersson


3 Answers

Voted Best Answer

The functionality of mobile PDF viewers lags behind the desktop versions by quite a bit. When you use the default PDF viewer on an iOS device, you will get Apple's viewer, which does not support any interactive features. Adobe's Reader for mobile does support forms, but the Javascript support is very limited. You can get a rough idea about what is supported here: http://www.adobe.com/devnet-docs/acrobatetk/tools/Mobile/index.html

As was already mentioned, Readdle's PDF Expert has the best support for JavaScript, but still does not support everything that you can do on the desktop. You will have to experiment and potentially modify your form so that it runs with whatever mobile viewer you are targeting.

Karl Heinz Kremer
PDF Acrobatics Without a Net
PDF Software Development, Training and More...
http://www.khkonsulting.com


By Karl Heinz Kremer   

What app are you using for the iPad? Adobe Reader for ios doesn't support Javascript(at least any that I've tried). However, PDF Expert by Readdle works wonderfully with JavaScript and is currently the app to beat.


Lane Pemberton   

Many scripts for forms that work with a computer may need to be rewritten to accomodate the lack of full support for JavaScript on mobile devices.

I would try rewritting the script to use the "if" statement and not the '?" statement.


George Kaiser   


Please specify a reason: