I use a textbox inside a gridview and its onkeyup function doesn't seem to work....
Here is my gridview
<asp:TemplateField>
<HeaderStyle Width="12%" />
<HeaderTemplate>
Advance Detucted
</HeaderTemplate>
<ItemTemplate>
<asp:TextBox ID="TxtAdvanceDeducted" runat="server"
CssClass="text_box_height_14_width_50" onkeyup="check('this');"></asp:TextBox>
</ItemTemplate>
<ItemStyle Width="12%" HorizontalAlign="Center" />
</asp:TemplateField>
And my javascript function,
var table = el.parentNode.parentNode.parentNode;
for (var y = 0; y < table.rows.length; y++)
{
for (var x = 0; x < table.rows[y].cells.length; x++)
{
if (table.rows[y].cells[x] == el)
{
alert("Row:" + y + " Cell: " + x);
}
}
}
When inspected through webdeveloper toolbar i got the error,
el.parentNode is undefined
Any suggestion...
alert(table.rows.length)
gave me 3... But i have 2 rows + one header row...