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:
<script type="text/javascript">
$(document).ready(function () {
$("#<%=txtSearch.ClientID %>").autocomplete({
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);
},
minLength: 1
});
});
</script>
HMTL Code"
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<div class="CSSTableGenerator">
<asp:Repeater ID="Repeater1" runat="server" >
<HeaderTemplate>
<table style="width: 100%;">
<tr>
<td style="width: 100px;">
Price Ref#
</td>
<td style="width: 100px;">
Out Ref#
</td>
<td style="width: 200px;">
Description
</td>
<td style="width: 100px;">
Quantity
</td>
<td style="width: 100px;">
Unit
</td>
<td style="width: 100px;">
Unit Price
</td>
<td style="width: 110px;">
USD
</td>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td>
<asp:TextBox ID="txtSearch" Width="100px" runat="server"></asp:TextBox>
</td>
<td>
<asp:TextBox ID="TextBox3" Width="100px" runat="server"></asp:TextBox>
</td>
<td>
<asp:TextBox ID="TextBox4" Width="200px" runat="server"></asp:TextBox>
</td>
<td>
<asp:TextBox ID="TextBox5" Width="100px" runat="server"></asp:TextBox>
</td>
<td>
<asp:TextBox ID="TextBox6" Width="100px" runat="server"></asp:TextBox>
</td>
<td>
<asp:TextBox ID="TextBox7" Width="100px" runat="server"></asp:TextBox>
</td>
<td>
<asp:TextBox ID="TextBox8" Width="100px" runat="server"></asp:TextBox>
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
</div>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="txtrows" />
</Triggers>
</asp:UpdatePanel>
can any one please help me, how to find the controld id, that is,
textbox id from a repeater in JQuery.
I have create one web user control and placed JQuery code & a textbox in the web user control and this userControl i have placed in the repeater.
some time it is calling the event but not all the time, why, i didn't get that.
when i placed this userControl outside that repeater then it is working good.
but not in the repeater.
Please help me guys.
i'm stuck from yesterday, trying hard, i'm behind my schedule. please help me.
Rended HMTL
the repeater code is not displaying in the view souces *** :O
please,
Thanks