Populate second dropdown on a form based on the first dropdown | Community
Skip to main content
carolinas675342
New Participant
March 12, 2022
Solved

Populate second dropdown on a form based on the first dropdown

  • March 12, 2022
  • 1 reply
  • 650 views

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.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by DEBAL_DAS

https://github.com/AdobeDocs/experience-manager-65.en/blob/main/help/forms/using/dynamically-populate-dropdowns.md 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.

 

1 reply

DEBAL_DAS
DEBAL_DASAccepted solution
New Participant
March 13, 2022

https://github.com/AdobeDocs/experience-manager-65.en/blob/main/help/forms/using/dynamically-populate-dropdowns.md 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.