Copy link to clipboard
Copied
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.
1 Correct answer
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...
Copy link to clipboard
Copied
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...
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
... except that the "exportValues" property isn't available on mobile either.
Copy link to clipboard
Copied
True. You will need to know the export value in advance and hard-code it into the script.
Copy link to clipboard
Copied
The "export value" is used for setting the value of a check box widget. Once the value of each widget in the exclusionary group has been set, one only needs to test the value of the group. So if one wants to know if none of the check boxes in a group has been selected, they only need to to test for the value of "Off". Or to see if anyone has been selected the the value would be not equal to "Off".
Copy link to clipboard
Copied
What about a way to hide a checkbox based on another checkbox selection? Of course, that will work on IOS.
Copy link to clipboard
Copied
Nope. The field properties on mobile are limited to "name", "value", and "type". The "display" property isn't one of them.
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
I can control it pretty completely, In what way would they have to load it?
Copy link to clipboard
Copied
Ok then. Take a look at the PDF Expert app. It is able to run more JavaScript than the Adobe mobile viewers but your recipients will need to know to open the file in that app. You can't set it as the default.

