Any way to display export value in field after selecting Item Value?

New Here ,
Jul 23, 2018

Copy link to clipboard

Copied

I'm trying to create a form that captures a lot of data, particularly vehicle accident data.  Some of the item values are very long.  What I would like to do is to allow those completing the form to select the Item value from the drop-down box, but populate the form with the export value, which I plan to have as numerical.  So if we have item values of Apple, Banana, and Cookie, with corresponding export values of 1, 2, 3, when the user selected Banana, the form would display 2.  Can that be done?  Any help would be appreciated.  Thank you.  

TOPICS
Acrobat SDK and JavaScript

Views

62

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

Any way to display export value in field after selecting Item Value?

New Here ,
Jul 23, 2018

Copy link to clipboard

Copied

I'm trying to create a form that captures a lot of data, particularly vehicle accident data.  Some of the item values are very long.  What I would like to do is to allow those completing the form to select the Item value from the drop-down box, but populate the form with the export value, which I plan to have as numerical.  So if we have item values of Apple, Banana, and Cookie, with corresponding export values of 1, 2, 3, when the user selected Banana, the form would display 2.  Can that be done?  Any help would be appreciated.  Thank you.  

TOPICS
Acrobat SDK and JavaScript

Views

63

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
Jul 23, 2018 0
try67 LATEST
Most Valuable Participant ,
Jul 23, 2018

Copy link to clipboard

Copied

Yes, very easily. Just apply the numeric values as the export values of the items in your drop-down and then use something like this as the custom calculation script of the text field where you want to display them:

event.value = this.getField("Fruit").valueAsString;

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