Expand my Community achievements bar.

SOLVED

Populate second dropdown on a form based on the first dropdown

Avatar

Level 1

Hi, this is my first time searching for help on this forum.

  1. Let me try to explain myself; I need to populate the options of a second dropdown based on what the user selects on the first one. For example, let's say that the first dropdown has Countries, so the second one doesn't have any option until the user selects for example USA and then the second one now has different options such as California, Texas, NY, Nevada, etc.
    The previous needs to be on a form, not on the dialog, so the user can select the options.
  2. Also, is there any way to author the data? For example, using Content Fragments, ACS AEM Commons, a JSON file uploaded to the DAM with each country as an array with the states/cities or any other alternative to define which options should be displayed on the second dropdown based on each option of the first one.

Thanks in advance, any help will be useful since I already tried different options with no luck, so I'm a bit frustrated to be honest.

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

https://github.com/AdobeDocs/experience-manager-65.en/blob/main/help/forms/using/dynamically-populat... will help you to implement point:1 

 

I feel a JSON file with requisite data like mapping between country and state/cities is aligned with above code.

 

Please review.

 

View solution in original post

1 Reply

Avatar

Correct answer by
Employee Advisor

https://github.com/AdobeDocs/experience-manager-65.en/blob/main/help/forms/using/dynamically-populat... will help you to implement point:1 

 

I feel a JSON file with requisite data like mapping between country and state/cities is aligned with above code.

 

Please review.