samedi 18 avril 2015

How to set context key in JQuery autocomplete


$('#StateName').autocomplete({

source: '/Home/GetStateNameSuggestion?CountryId=' + $('#CountryNameHF').val() + '&',
select: function (event, ui) {
searchState(ui.item.label);
return true;
},
change: function (event, ui) {
if (!ui.item) {
this.value = '';
}
}
});


in the above code $('#CountryNameHF').val() is always null.


Aucun commentaire:

Enregistrer un commentaire