Trying to make two chained auto populating select fields using select2 plugin The first select contains countries names(static select) and the second shows the states of the
you missed commas in json response.
http://jsfiddle.net/jEADR/1570/
var data = [{"id":"1","text":"Chigaco"},{"id":"4","text":"Albama"},{"id":"2","text":"Tulsa"}]; var data2=[]; $.map(data, function(item) { data2.push( { id: item.id, text: item.text }); }); $('#state').select2({ data: data2 });