Highlighted

PDF javascript not working on Mobile - Android/ iOs

New Here ,
Aug 10, 2020

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

TOPICS
Android, iOS, PDF forms

Views

211

Likes

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

PDF javascript not working on Mobile - Android/ iOs

New Here ,
Aug 10, 2020

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

TOPICS
Android, iOS, PDF forms

Views

212

Likes

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
Aug 10, 2020 0
Adobe Community Professional ,
Aug 10, 2020

Copy link to clipboard

Copied

How does you populate the dropdown?

Likes

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
Reply
Loading...
Aug 10, 2020 0
New Here ,
Aug 10, 2020

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

 

 

Likes

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
Reply
Loading...
Aug 10, 2020 0
Adobe Community Professional ,
Aug 10, 2020

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 

Likes

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
Reply
Loading...
Aug 10, 2020 0
New Here ,
Aug 10, 2020

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"]);

Likes

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
Reply
Loading...
Aug 10, 2020 0
Adobe Community Professional ,
Aug 10, 2020

Copy link to clipboard

Copied

With resetForm you can only reset fields to default values.

Likes

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
Reply
Loading...
Aug 10, 2020 0
New Here ,
Aug 10, 2020

Copy link to clipboard

Copied

Thank you. That means no other way to achieve this in mobile devices, right?

Likes

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
Reply
Loading...
Aug 10, 2020 0
Most Valuable Participant ,
Aug 10, 2020

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.

Likes

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
Reply
Loading...
Aug 10, 2020 0
ec899 LATEST
New Here ,
Aug 10, 2020

Copy link to clipboard

Copied

that's bad news. I need it to work on both iOS and Android

Likes

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
Reply
Loading...
Aug 10, 2020 0