Js Section:
Copy codeThe Code is as follows: var checkboxs = document. getElementsByTagName ("input ");
For (var I = 0; I <checkboxs. length; I ++)
{
If (checkboxs [I]. type = "checkbox" & checkboxs [I]. checked = true ){
Var trobj = checkboxs [I]. parentNode. parentNode; // locate the tr node.
If (trobj. rowIndex> 0 ){
Var tdobj = trobj. children;
Var amount = tdobj [3]. children. item (0). value; // find the value of the td node corresponding to the 4th td
Alert (amount );
}
}
}
Html repeater Copy codeThe Code is as follows: <asp: repeater id = "repeater1" runat = "server">
<ItemTemplate>
<Tr class = "TableDetail2">
<TD>
<Input type = checkbox name = "checkboxs" ID = "checkbox" Runat = "server" Width = "15" value = '<% # Container. dataItem ("mocode") %> '/>
</TD>
<Td class = "nowrap">
<Asp: ImageButton id = "btnkxcode" runat = "server" Width = "15" ImageUrl = "../image/search.jpg" CommandName = "btnkx"
Height = "15"> </asp: ImageButton>
<Asp: TextBox id = "ckxcode" runat = "server" CssClass = "TextBox1" Text = '<% # Container. DataItem ("itemtype") %>'>
</Asp: TextBox> </td>
<Td class = "nowrap">
<Asp: ImageButton id = "btnkxname" runat = "server" Width = "15" ImageUrl = "../image/search.jpg" CommandName = "btnkxn"
Height = "15"> </asp: ImageButton>
<Asp: TextBox id = "ckxname" runat = "server" CssClass = "TextBox1" Text = '<% # Container. DataItem ("itemname") %>'>
</Asp: TextBox>
</Td>
<Td class = "nowrap">
<Asp: TextBox id = "amount" runat = "server" CssClass = "TextBox1" Text = '<% # Container. DataItem ("ysamount") %>'>
</Asp: TextBox> </td>
</Tr>
</ItemTemplate>
</Asp: repeater>