Try our conversational search powered by Generative AI!

How to create dependent drop down boxes


I am looking into a way to create dependent dropdown.

The situation is usual. One dopdows is used to select country and the second dropdown is used to select city.
Choices of second dropdown should obviuosly depend on first.

Is there supported way to archieve this in EPiServer?
I have found example Here but it requires extending some episrever classes, which is prone to breakage and also it's not generic.

Maybe there is supported way to do that in EPiServer 8?


Apr 10, 2015 9:29

Are you talking about EPiServer Admin/Edit UI where you would need to play around some dojo, or in site page template itself (where end-users are going)?

If latter - these examples may give you some ideas.

Apr 10, 2015 14:58

I would take a step back and look at the case in question. What is the editor editing?

If it's an address you can count on selecting available cities from some service won't cut it, someone lives on a farm etc. In this case a zipcode database is a more likely candidate. And if so I would only make the editor input a valid zip code and output the city from the database.

If it's a "Find the nearest reseller" case you probably already have master data and don't need to make an EPi editor input anything in relation to contact info.

If it's just a about location, show a map and retrieve a selected coordinate.

Etc etc... A Country => City dropdown need should come way way down.

Apr 13, 2015 10:25

Hi Johan,

Giedrius is asking about a technical solution to a common problem - dependent dropdowns - the nature of the content of those dropdowns is irrelevant to the question being asked.


Jan 05, 2018 14:15

This post has similar code to what you want although it may need to be adapted

Jan 05, 2018 17:45
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.