Copy link to clipboard
Copied
Hello,
I have created a dyanmic dropdown in Adobe Acrobat Pro DC.
Dropdown selection determines the selections in another dropdown. This is working fine in desktop but when tested in mobile device - iOS/Android, nothing happens. Dropdown2 doesn't get populated.
Do you guys have any idea?
Javascript code is a simple switch statement.
Thanks,
EC
Copy link to clipboard
Copied
The method setItems is not available in Acrobat Reader for Android or iOS:
https://www.adobe.com/devnet-docs/acrobatetk/tools/Mobile/js.html
Copy link to clipboard
Copied
How does you populate the dropdown?
Copy link to clipboard
Copied
Hi Bernd,
I use a simple switch statement which I placed under Custom Keystroke Script.
switch (event.change) {
case "SELECT YOUR CITY":
this.getField("Street").setItems(["SELECT YOUR STREET"]);
break;
case "NEW YORK":
this.getField("Street").setItems(["SELECT YOUR STREET","STREET 1", "STREET 2"]);
break;
case "CHICAGO":
this.getField("Street").setItems(["SELECT YOUR STREET","STREET 3", "STREET 4"]);
break;
.
.
.
.
.
}
Copy link to clipboard
Copied
The method setItems is not available in Acrobat Reader for Android or iOS:
https://www.adobe.com/devnet-docs/acrobatetk/tools/Mobile/js.html
Copy link to clipboard
Copied
Thanks for that Bernd.
Does that mean I should use resetForm?
this.getField("Street").resetForm(["SELECT YOUR STREET","STREET 3", "STREET 4"]);
Copy link to clipboard
Copied
With resetForm you can only reset fields to default values.
Copy link to clipboard
Copied
Thank you. That means no other way to achieve this in mobile devices, right?
Copy link to clipboard
Copied
Do not count on any scripts working in Adobe Reader Mobile, unfortunately. Your best chance is using PDF Expert by Readdle on iOS devices.
Copy link to clipboard
Copied
that's bad news. I need it to work on both iOS and Android
Copy link to clipboard
Copied
There is a "Foxit PDF reader" on android. It can read pdf with scripts
Copy link to clipboard
Copied
Foxit PDF Reader works for me , many thanks for that suggestion.
Have the following JS to change the colour of a field depending on the value. Works well on PC, but won't work on in Adobe Reader on Android
var pres=this.getField("pressure").value;
var total=0;
var partial=0;
if (pres<101)
{
this.getField("result").value="FAIL";
this.getField("result").fillColor=color.red;
total=total+10
}
else if (pres>111)
{
this.getField("result").value="FAIL";
this.getField("result").fillColor=color.red;
total=total+10
}
else if (pres>=101 && pres<=111)
{
this.getField("result").value="PASS";
this.getField("result").fillColor=color.green;
}