hi I want a function like this! https://i.sstatic.net/p61fq.png
when I select the first "select tag"
the secoud "select tag" show undefined
but in this picture the CONSOLE area is exactly show what I want.
My problem is...how to show the data in second "select tag"?
I think it's something wrong in my javascript.
$.ajax({
type: "POST",
url: "dropdownServlet",
data: dataString,
dataType: "json",
success: function( data, textStatus, jqXHR) {
$("#dropdown2").html("");
$.each(data, function(){
$.each(this,function(){
$("#dropdown2").append("<option>"+data.CiytName+"</option>");
});
});
},
and this's my json data
[{"CityId":"4","CityName":"Vancouver"},{"CityId":"5","CityName":"Toronto"}]