I am quit new in jquery. I have implemented the jquery autocomplete textbox, where I load data from SQL server. Upon selecting an item from the dropdown, I fill some controls on the form. I also want to change the text property of a button. Below is my jquery code:
$(function () {
$("#<%=txtSearch.ClientID%>").autocomplete({
source: function (request, response) {
$.ajax({
url: "/customers/customers.asmx/fncFetchCustomerList",
data: "{ 'strFullname': '" + request.term + "' }",
dataType: "json",
type: "POST",
contentType: "application/json; charset=utf-8",
dataFilter: function (data) { return data; },
success: function (data) {
response($.map(data.d, function (item) {
return {
value: item.Fullname,
Firstname: item.FirstName,
Email: item.Email
}
}))
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
alert(textStatus);
}
});
},
select: function (event, ui) {
$('#<%=txtFName.ClientID%>').val(ui.item.Firstname);
$('#<%=txtEmail.ClientID%>').val(ui.item.Email);
$('#<%=btnSubmit.ClientID%>').val("Update");
},
minLength: 2
});
});
My problem is, upon changing the text property of the button to "Update", when i run a server side code and check for the text of the button, it doesn't read "Update".
Any help on this will be appreciated.
Thank you.