Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events

Drop-downs contingent on selection question

Avatar

Former Community Member
I'm trying to make drop-down boxes contingent upon each other. For example: The first box would include color, shape. And depending on which you selected, the second box would either include colors or shapes. Does anyone have any idea how to do this?
1 Reply

Avatar

Former Community Member
You will have to write code to do this. To get the value of the 1st dropdown use DropDownName.rawValue. Write your code on the exit event as the value will not be committed until you exit. Then you can use the DropDownName.addItem(value, value) to populate the dropdown. You will have to add the items one at a time. The 1st value is the value that the user will see in the dropdown. The 2nd value is the one that will be submitted when data is set out of the form. If you want them to be the same only use a single value.