There are 5 select list in my html page. all the select list populate dynamically with a json response from a ajax call. In the ajax success function i need to set a value selected for each select list.
but changing value of select list is randomly fails for different select lists different time. I tried several way and what i found is jQuery is executing the next line when it takes time to change the value and never go to previous.
I tried change() function, ready() function, load() function etc with no success. i need to wait until the previous select list value has changed. how can i do that. here is my sample code.
var jsonParam = '';
var serviceURL = "./someurl";
AjaxManager.SendJson(serviceURL, jsonParam, onSuccess, onFailed);
function onSuccess(jsonData) {
$('#cmb1').val(jsonData.Field1);
$('#cmb2').val(jsonData.Field2);
$('#cmb3').val(jsonData.Field3);
$('#cmb4').val(jsonData.Field4);
$('#cmb5').val(jsonData.Field5);
}