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

javascript on ipad

New Here ,
Dec 12, 2017 Dec 12, 2017

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.

TOPICS
Acrobat SDK and JavaScript

Views

2.7K

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

correct answers 1 Correct answer

Community Expert , Dec 12, 2017 Dec 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)

Votes

Translate

Translate
Community Expert ,
Dec 12, 2017 Dec 12, 2017

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...

JavaScript for Acrobat Reader Mobile API Reference (iOS)

Votes

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 ,
Dec 12, 2017 Dec 12, 2017

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.

Votes

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 ,
Dec 12, 2017 Dec 12, 2017

Copy link to clipboard

Copied

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

Votes

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 ,
Dec 13, 2017 Dec 13, 2017

Copy link to clipboard

Copied

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

Votes

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
LEGEND ,
Dec 13, 2017 Dec 13, 2017

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".

Votes

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
New Here ,
Dec 19, 2017 Dec 19, 2017

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.

Votes

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 ,
Dec 19, 2017 Dec 19, 2017

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.

Votes

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
New Here ,
Dec 19, 2017 Dec 19, 2017

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?

Votes

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 ,
Dec 19, 2017 Dec 19, 2017

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.

Votes

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
New Here ,
Dec 19, 2017 Dec 19, 2017

Copy link to clipboard

Copied

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

Votes

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 ,
Dec 20, 2017 Dec 20, 2017

Copy link to clipboard

Copied

LATEST

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.

Votes

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