<script language="javascript" type="text/javascript">
//实现GridView的CheckBox全部选择和全部取消
function CheckAll(checkbox)
{
var elements = checkbox.form.elements;
for(var i = 0;i < elements.length;i++)
{
if(elements[i].type == "checkbox" && elements[i].id != checkbox.id)
{
elements[i].checked = checkbox.checked;
}
}
}
</script>
方法二://实现GridView的CheckBox全部选择和全部取消
function CheckAll(checkbox)
{
var elements = checkbox.form.elements;
for(var i = 0;i < elements.length;i++)
{
if(elements[i].type == "checkbox" && elements[i].id != checkbox.id)
{
elements[i].checked = checkbox.checked;
}
}
}
</script>
<script type="text/javascript">
//<![CDATA[
function CheckAll(oCheckbox)
{
var GridView2 = document.getElementById("<%=GridView2.ClientID %>");
for(i = 1;i < GridView2.rows.length; i++)
{
GridView2.rows[i].cells[0].getElementsByTagName("INPUT")[0].checked = oCheckbox.checked;
}
}
//]]>
</script>
//<![CDATA[
function CheckAll(oCheckbox)
{
var GridView2 = document.getElementById("<%=GridView2.ClientID %>");
for(i = 1;i < GridView2.rows.length; i++)
{
GridView2.rows[i].cells[0].getElementsByTagName("INPUT")[0].checked = oCheckbox.checked;
}
}
//]]>
</script>