I have been trying to get some dependent dropdowns to work with select2 (http://ivaynberg.github.io/select2/
) and ajax, however I don't think I have it nailed it (well I know I haven't).
When I select the value from the first dropdown then the second dropdown loads OK, however, once I select the value from the second dropdown, then it shows as "undefined".
I have created a quick demo which (funnily enough) demonstrates what I am doing as well as the behaviour that occurs. To repro:
1) Unzip the attached zip into your www folder
2) Go to http://
3) Pick a country from the first dropdown
4) Pick a state from the second dropdown
Should then see "undefined" in the second dropdown.
If someone could help me out with this / point me in the correct direction that would be super awesome and much appreciated :)