asp.net - How to fire an textchange event of autocomplete jquery ajax function when manualy a value is entered or selected from the list? -
<script type="text/javascript"> function origin(sender, args) { $(function () { $("#<%=info.clientid %>").autocomplete({ source: function (request, response) { $.ajax({ url: '<%=resolveurl("~/webservice.asmx/get") %>', data: "{ 'prefix': '" + request.term + "'}", datatype: "json", type: "post", async: false, mustmatch: true, contenttype: "application/json; charset=utf-8", success: function (data) { response($.map(data.d, function (item) { return { label: item.split('-')[0], val: item.split('-')[1] } })) }, error: function (response) { }, failure: function (response) { } }); }, select: function (e, i) { $("#<%=hdnshipperinfo.clientid %>").val(i.item.val); if (i.item.val == "no records found") { $("#<%=hdninfo.clientid %>").val(-1); document.getelementbyid('<%=info.clientid%>').value = ""; return false; } }, minlength: 0 }).bind('focus', function () { $(this).autocomplete("search"); }); $(".selector").autocomplete({ change: function (event, ui) { info(); } }); }); } </script>
Comments
Post a Comment