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

Add dropdown selection to list box items

Community Beginner ,
Jan 03, 2019 Jan 03, 2019

Hello,

Here's what I'm trying to do:

Selecting the item# from a dropdown generates a list of ingredients for that item in another dropdown. The selected ingredient from the "Ingredient" dropdown will then be added to the "Order" list box. The goal is to be able to select ingredients in the order they were used. I'm close, I've got the code pretty much worked out.

Here's my code:

For "Item" drop down custom validation script to "Ingredient" list box-

switch (event.value) {

    case " ":

        this.getField("Ingredient").setItems([" "]);

        break;

    case "Item1":

        this.getField("Ingredient").addItems(["ing1","ing2"]);

        break;

    case "Item2":

        this.getField("Ingredient").addItems(["ing3","ing2"]);

        break;

}

The issue is "ing1" is being automatically selected and transferred to the "Order" list and I want to have to select each one manually.

Thank you in advance for the assistance!

679
Translate
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 03, 2019 Jan 03, 2019

That's how it works. The first item in the list is the default item.

Translate
Community Expert ,
Jan 03, 2019 Jan 03, 2019

There's no such method called "addItems". Use setItems.

Translate
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 ,
Jan 03, 2019 Jan 03, 2019

Oh right, thank you. The issue of the first item being automatically selected remains however.

Translate
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 Expert ,
Jan 03, 2019 Jan 03, 2019
LATEST

That's how it works. The first item in the list is the default item.

Translate
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