I am trying to accomplish dropdowns using JSON. I want 3 dropdowns. First populate the country dropdown (eg: usa, uk etc.,). Now, when the user select USA then states dropdown needs to be populated by using jQuery .change(). Again when user select the state they need to be presented with cities dropdowns.
How can I achieve this? As my JSON file is slightly big I have added it here and tried to populate countries dropdown but unable to generate states and cities drop down...
$.each(myJson.country, function (index, value) {
$(#country).append('<option value='+value.id+'>'+value.name+'</option>');});
The above code helps me populate just the countries but not others like states and cities. Any help is much appreciated.
Thanks in advance.