Skip to main content
bryang51000329
Participating Frequently
December 12, 2017
Answered

javascript on ipad

  • December 12, 2017
  • 4 replies
  • 4104 views

Hello,

    I have an awesome PDF Form that works perfectly on my PC. However many of the javascripts I'm using to make it so when you check a box another checks/unchecks are not working on iPad. Here are 2 samples. Anyone know how to get this working?

Example 1

if (event.target.value!="Off") this.getField("15moLoyalty").checkThisBox(0, true);

Example 2

if (event.target.value!="Off") this.getField("15moLoyalty").checkThisBox(0, false);

Here is another try I took doing it as a calculation field. This wont work on the iPad either.

Example 3

var f = this.getField("plans");

if(f.isBoxChecked(0)){

getField("15moLoyalty").checkThisBox(0,true);

getField("10moBundle").checkThisBox(0,true);

getField("10mowireless").checkThisBox(0,true);

}

else if(f.isBoxChecked(1)){

getField("15moLoyalty").checkThisBox(0,true);

getField("10moBundle").checkThisBox(0,true);

getField

("10mowireless").checkThisBox(0,true);

}

else if(f.isBoxChecked(6)){

getField("15moLoyalty").checkThisBox(0,false);

getField("10moBundle").checkThisBox(0,false);

getField

("10mowireless").checkThisBox(0,false);

}

else if(f.isBoxChecked(7)){

getField("15moLoyalty").checkThisBox(0,false);

getField("10moBundle").checkThisBox(0,false);

getField

("10mowireless").checkThisBox(0,false);

}

else {

getField("15moLoyalty").checkThisBox(0,false);

getField("10moBundle").checkThisBox(0,true);

getField

("10mowireless").checkThisBox(0,true);

}

The weird thing is I have some advanced Javascript that works for other calculations. Just can't figure this one out. Any help would be appreciated.

This topic has been closed for replies.
Correct answer Joel Geraci

The Reader on iPad is far less capable than the desktop version. The code just isn't going to work. The "checkThisBox" method just isn't there.

See the documentation here...

JavaScript for Acrobat Reader Mobile API Reference (iOS)

4 replies

bryang51000329
Participating Frequently
December 19, 2017

Ok so with the export value. Im pretty "copy/paste" then limited editing in coding. Could someone provide an example of how I might get that to work?

Joel Geraci
Community Expert
Community Expert
December 19, 2017

Before you get too much farther... how much are you able to control how the PDF will be viewed on iOS? If you won't be in a position to instruct the recipients on how to open the PDF in the Adobe Acrobat Reader app, you really shouldn't bother with any of this.

bryang51000329
Participating Frequently
December 20, 2017

I can control it pretty completely, In what way would they have to load it?

bryang51000329
Participating Frequently
December 19, 2017

What about a way to hide a checkbox based on another checkbox selection? Of course, that will work on IOS.

Joel Geraci
Community Expert
Community Expert
December 19, 2017

Nope. The field properties on mobile are limited to "name", "value", and "type". The "display" property isn't one of them.

try67
Community Expert
Community Expert
December 12, 2017

Instead of the unsupported checkThisBox method you can simply set the value property directly. Use "Off" to check the box off, and its export value to check it on.

Joel Geraci
Community Expert
Community Expert
December 13, 2017

... except that the "exportValues" property isn't available on mobile either.

try67
Community Expert
Community Expert
December 13, 2017

True. You will need to know the export value in advance and hard-code it into the script.

Joel Geraci
Community Expert
Joel GeraciCommunity ExpertCorrect answer
Community Expert
December 12, 2017

The Reader on iPad is far less capable than the desktop version. The code just isn't going to work. The "checkThisBox" method just isn't there.

See the documentation here...

JavaScript for Acrobat Reader Mobile API Reference (iOS)