try this,
dont use
href
to call javascript object, you wont be able to get the current object ( Anchor tag) instead you will get the
window
object.
you will have to use
onclick
event to pass the
current anchor object to the javascript function..
and you have to pass
this
object to the javascript function,
provide the header td's in the
Header template
, else the DOM of repeater will not be in a proper manner, It will be difficult to find the elements using Jquery..
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<script src="jquery-1.8.2.js"></script>
<title></title>
<script>
function Destroy(anchorObj, vid) {
var value = $(anchorObj).closest('td').find("input[id*='txtDestroyQty']").val();
alert(value);
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Repeater ID="rptDestroy" runat="server">
<HeaderTemplate>
<table>
<tr>
<td></td> <td></td> <td></td> <td></td><td></td><td></td>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td><%#Eval("productName") %></td>
<td><%#Eval("ProductId") %></td>
<td><%#Eval("Attid") %></td>
<td><%#Eval("vname") %></td>
<td><%#Eval("PendingQty") %></td>
<td>
<asp:TextBox ID="txtDestroyQty" CssClass="txt" runat="server"></asp:TextBox>
<a href="#" onclick="Javascript:Destroy(this,'<%#Eval("vendorId") %>')">Destroy</a>
</td>
</tr>
</ItemTemplate>
</asp:Repeater>
</div>
</form>
</body>
</html>