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

Unable to perform a calculation on a set of dropdowns

Community Beginner ,
Jan 31, 2019 Jan 31, 2019

Copy link to clipboard

Copied

I have 6 dropdowns but based on space restrictions I had to include a script that showed the dropdown options on two lines instead of just one (kinda like a wrap around).  I have the export values set for each item and a text box (TOTAL) that is set to calculate the export value for each dropdown based on the selections.  However, the calculation is not happening.  I'm sure it has something to do with the "wrap around" script, but I have no idea what I need to do next.  Any suggestions would be appreciated.  Below is how I have things set up right now.

Dropdown1 through Dropdown 6:

ITEM:           FullyMet     MostlyMet     PartiallyMet     SomewhatMet     NotMet

EXPORT:          10               7.5                    5.0                    2.5                  0

Wrap around script on ACTION tab for each dropdown:

this.getField("Dropdown1").setItems(["Fully\nMet", "Mostly\nMet", "Partially\nMet", "Somewhat\nMet", "Not\nMet"]);

TOTAL box:  CALCULATE tab, Value is the sum(+) of the following fields: Q1, Q2, Q3, Q4, Q5, Q6

TOPICS
Acrobat SDK and JavaScript , Windows

Views

138

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
community guidelines

correct answers 1 Correct answer

Community Expert , Jan 31, 2019 Jan 31, 2019

You did not set the export values. To do so you need to use this command:

this.getField("Dropdown1").setItems([["Fully\nMet", 10], ["Mostly\nMet", 7.5], ["Partially\nMet", 5], ["Somewhat\nMet", 2.5], ["Not\nMet", 0]]);

Note that adding line-breaks into the items of a drop-down field is not an official feature and tends to be buggy. I would recommend not doing it, if at all possible.

Likes

Translate

Translate
Community Expert ,
Jan 31, 2019 Jan 31, 2019

Copy link to clipboard

Copied

You did not set the export values. To do so you need to use this command:

this.getField("Dropdown1").setItems([["Fully\nMet", 10], ["Mostly\nMet", 7.5], ["Partially\nMet", 5], ["Somewhat\nMet", 2.5], ["Not\nMet", 0]]);

Note that adding line-breaks into the items of a drop-down field is not an official feature and tends to be buggy. I would recommend not doing it, if at all possible.

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
community guidelines
Community Beginner ,
Feb 01, 2019 Feb 01, 2019

Copy link to clipboard

Copied

LATEST

I was not aware that the line breaks could be an issue.  Thank you for that information.  Additionally, adding in the export values to the command worked perfectly!  try67​, Thank you for responding!

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
community guidelines