<asp:GridView runat="server" ID="GridView1" AutoGenerateColumns="False" AllowPaging="True" OnPageIndexChanging="Repeater1_PageIndexChanging">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<table style="width:250px; height:30px; border-bottom:solid 1px #888; float:right;" class="table_content">
<tr>
<td style="width:35%">
<asp:CheckBox runat="server" ID="chk_numb"/>
<asp:HiddenField runat="server" ID="h_numb" Value='<%#Eval("numb") %>' />
<%#Eval("cnname") %>
</td>
<td style="width:35%"><%#Eval("curlevel") %></td>
<td style="width:30%">
<asp:Label runat="server" ID="Lable" Text='<%#Eval("cc") %>'/></td>
</tr>
</table>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>请问怎样用javascript判断
当checkbox选择某行时,它要判断同一行label里的值,如果它>8,Checkbox的 checked属性为false.请问怎样根据
function setChecked(chk){
var tr= chk.parentNode.parentNode;
if(parseInt( tr.cells[tr.cells.length-1].getElementsBytagName('span')[0].innerHTML)>8){
chk.checked = false;
}
}
{
System.Web.UI.WebControls.Label lbl= (System.Web.UI.WebControls.Label)gvHouseInfo.Rows[i].FindControl("Lable");
if (int.Parse(lbl.Text)>8)
{
HtmlInputCheckBox cbo= (HtmlInputCheckBox)gvHouseInfo.Rows[i].FindControl("CheckBox "); cbo.Checked=false;
}
}