Trying to replicate an excel formula in a form

Jan 19, 2018

Copy link to clipboard

Copied

Hello all,

In Excel, I had a dropdown cell and then other cells throughout the page linked to item selected in the dropdown to change based on the selection.  In practice it's a simple IF THEN statement, however I'm having trouble replicating this in JavaScript.

For example, if the dropdown box choices are (Gold, Silver, Copper), then I need a separate textbox to populate with (150,100,50) respectively, and then another separate textbox still linked to the dropdown choice to populate with (A,B,C) etc and so on throughout the page as needed, all hinging on the dropdown choice selected.

This is what I used in Excel, is this possible to replicate?

  =IF($I$12="Gold",150,IF($I$12="Silver",100,IF($I$12="Copper",50,IF($I$12="________",0))))

Any advice or direction would be appreciated.  Thank you.

Eric

TOPICS
Acrobat SDK and JavaScript

Views

88

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

Trying to replicate an excel formula in a form

Jan 19, 2018

Copy link to clipboard

Copied

Hello all,

In Excel, I had a dropdown cell and then other cells throughout the page linked to item selected in the dropdown to change based on the selection.  In practice it's a simple IF THEN statement, however I'm having trouble replicating this in JavaScript.

For example, if the dropdown box choices are (Gold, Silver, Copper), then I need a separate textbox to populate with (150,100,50) respectively, and then another separate textbox still linked to the dropdown choice to populate with (A,B,C) etc and so on throughout the page as needed, all hinging on the dropdown choice selected.

This is what I used in Excel, is this possible to replicate?

  =IF($I$12="Gold",150,IF($I$12="Silver",100,IF($I$12="Copper",50,IF($I$12="________",0))))

Any advice or direction would be appreciated.  Thank you.

Eric

TOPICS
Acrobat SDK and JavaScript

Views

89

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
Jan 19, 2018 0
Jan 19, 2018

Copy link to clipboard

Copied

Read this:

https://acrobatusers.com/tutorials/change_another_field

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...
Jan 19, 2018 0
Jan 22, 2018

Copy link to clipboard

Copied

Thanks, that seemed to work, though it required me to upgrade my 9 to 9 Pro!

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...
Jan 22, 2018 1
Jan 22, 2018

Copy link to clipboard

Copied

So you had Standard?  The old 9 standard limited script development through the UI. However, it's possible to insert the scripts into the correct places using a console script. So standard actually has most of the functionality of Pro, it's just not on the UI.

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...
Jan 22, 2018 0
Jan 23, 2018

Copy link to clipboard

Copied

This free tool allows you to use hidden JavaScript functionality in Acrobat Standard : Document Level Scripts With Acrobat Standard - KHKonsulting LLC

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...
Jan 23, 2018 0