Select2 Dependent / Cascading Select List Example

Select2 Dependent / Cascading Select List

Back to Tutorial

Select2 Cascade Demo For this post

Making Select2 (4.x) list boxes cascading / dependent.

That means, options of a select2 list box will be loaded/refreshed by ajax based on selection of another select2 list box. Let's try it -

Get the code

The source code is available as a public gist. Don't forget to it!

Raw gist

The list data is serving here from a secret gist. Just using the raw version of files to get the JSON.

Behind the scene

You may keep an eye on browser console to check the requests and response data.

Twitter Bootstrap

This demo is using Twitter Bootstrap, my first choice of CSS Frameworks.