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!

JSON Blob

The list data is serving here from JSON Blob. Thanks to JSON Blob!

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.