My second select dropdown is populating with each letter of the data I'm returning from my server and not each item itself.
Here's my JQuery;
var selected_table = $("#id_TableName option:selected").text();
$.get('/historicaldata/input_parameters/', { selected_table : selected_table }, function(data){
for (var i = 0; i < data.length; i++) {
for (var key in data[i]) {
$('<option />', {
value: key,
text: data[i][key]
}).appendTo("#id_ColumnName");
}
}
});
My data looks like this when it is returned from my view after the GET request;
{'option1': ['option1'], 'option2': ['option2'], 'option3': ['option3']}
Although I've tried a few similar formats and the outcome is the same so I think the fault is with the JQuery.
Thanks!