Try our conversational search powered by Generative AI!

How to create dependent drop down boxes

Vote:
 

Hello,
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?

Regards,
Giedrius

#120096
Apr 10, 2015 9:29
Vote:
 

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.

#120132
Apr 10, 2015 14:58
Vote:
 

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.

#120172
Apr 13, 2015 10:25
Vote:
 

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.

Marshall

#186842
Jan 05, 2018 14:15
Vote:
 

This post has similar code to what you want although it may need to be adapted https://developerschallenges.com/2017/12/30/episerver-how-to-set-a-value-on-the-server-side-and-update-the-all-properties-view/

#186849
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.