I want to store the value returned from a webservice to a hidden field in jquery
$.ajax({
type: "POST",
url: "/AutoComplete.asmx/CompareGroupName",
data: { Text: text },
dataType: "json",
onfocusout: function (element) {
$(element).valid();
$(element).filter('.valid').qtip('destroy');
},
success: function (data) {
response($.map(data.d, function (item) {
return {
value: item.igroup_id
}
$('#hdnGroupNameCheck').val = item.igroup_id;
}))
},
complete: function (xhr) {
if (xhr.status == 200) {
alert("Group Name already exist");
}
else
alert("Group Name does not exist");
}
});
I am getting Group already exists and Group does not exist and webservice is running fine.
But how to get the id in the hidden field and display the same message through code behind in asp.net.
Thanks
1 Answer