hi,
I have using an JQuery Autocompleter to show the list of values from database inside an textbox.
Its works fine, untill i used TEXTCHANGED event of that textbox. Now i need to use TEXTCHANGED event to update user changed values.
While i type "a" it will shows me list of words starts with "a" like "asp.net, asp..."
Problem is, if user select the values from "mouse" it will lost focus and TEXTCHANGED event raised. But while i hit TAB or ENTER key its works fine.
Hence i thought of using "HIDDEN FIELD" and save the value of textbox and retrieve it.
After big research i found the value, which was assigned to TEXTBOX inside "autocomplete.js"
I did check it out by made an "alert()"
I'm newer to JQuery, Please help me out.
My code is below...
<link href="../../StyleSheets/jquery.autocomplete.css" rel="stylesheet" type="text/css" />
<script src="../../StyleSheets/SearchScript/jquery-1.4.1.min.js" type="text/javascript"></script>
<script src="../../StyleSheets/SearchScript/jquery.autocomplete.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#<%=txt_custname.ClientID%>").autocomplete('CustomerHandler.ashx');
var data = $('#txt_custname.ClientID').value;
$('#hidden').val(data);
if(data != "")
{
var hid = $('#hidden').value;
alert(hid);
}
});
</script>
<asp:HiddenField ID="hidden" runat="server"/>