how to find control id from a repeater in a jquery code

Posted by Subhani.029 under ASP.NET on 10/12/2014 | Points: 10 | Views : 1170 | Status : [Member] | Replies : 0
Hi guys,

i have asp.net website where i'm using JQuery for autocomplete textbox.

successfully i did for autocomplete textbox, but when i'm placing it in a repeater,
then the jquery is not able to find the id of textbox.

my JQuery Code:
Collapse | Copy Code
<script type="text/javascript">
$(document).ready(function () {
$("#<%=txtSearch.ClientID %>").autocomplete({ //finding textbox id
source: function (request, response) {
$.ajax({
url: '<%=ResolveUrl("~/Service.asmx/GetCustomers") %>',
data: "{ 'prefix': '" + request.term + "'}",
dataType: "json",
type: "POST",
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) {
alert(response.responseText);
},
failure: function (response) {
alert(response.responseText);
}
});
},
select: function (e, i) {
$("#<%=hfCustomerId.ClientID %>").val(i.item.val);// hidden field id
},
minLength: 1
});

});
</script>




please,

Thanks




Responses

(No response found.)

Login to post response