<script language="javascript" type="text/javascript"> function check_anyone_checked(form1) { var form_length = form1.length; var state = false; if( form_length >0 ) { for( i=0; i<form_length;i++) { if(form1.elements[i].type == 'checkbox') { if(form1.elements[i].checked == true) { state = true; } } } if(state==true) form1.allSelect.value="清除所有选择项"; else form1.allSelect.value="全选"; return state; } else { alert('无记录'); } } function btn_select_all_onclick(form1) { var form_length = form1.length; var state = check_anyone_checked(form1); if( state == true ) { for( i=0; i<form_length;i++) { if(form1.elements[i].type == 'checkbox') { form1.elements[i].checked = false; form1.allSelect.value="全选"; } } } else { for( i=0; i<form_length;i++) { if(form1.elements[i].type == 'checkbox') { form1.elements[i].checked = true; form1.allSelect.value="清除所有选择项"; } } } } </script> <script language="javascript">
function check_anyone_checked(form1)
{
var form_length = form1.length;
var state = false;
if( form_length >0 )
{
for( i=0; i<form_length;i++)
{
if(form1.elements[i].type == 'checkbox')
{
if(form1.elements[i].checked == true)
{
state = true;
}
}
}
if(state==true)
form1.allSelect.value="清除所有选择项";
else
form1.allSelect.value="全选";
return state;
}
else
{
alert('无记录');
}
}
function btn_select_all_onclick(form1)
{
var form_length = form1.length;
var state = check_anyone_checked(form1);
if( state == true )
{
for( i=0; i<form_length;i++)
{
if(form1.elements[i].type == 'checkbox')
{
form1.elements[i].checked = false;
form1.allSelect.value="全选";
}
}
}
else
{
for( i=0; i<form_length;i++)
{
if(form1.elements[i].type == 'checkbox')
{
form1.elements[i].checked = true;
form1.allSelect.value="清除所有选择项";
}
}
}
}
</script>
<script language="javascript" type="text/javascript"> function check_anyone_checked(form1) { var form_length = form1.length; var state = false; if( form_length >0 ) { for( i=0; i<form_length;i++) { if(form1.elements[i].type == 'checkbox') { if(form1.elements[i].checked == true) { state = true; } } } if(state==true) form1.allSelect.value="清除所有选择项"; else form1.allSelect.value="全选"; return state; } else { alert('无记录'); } } function btn_select_all_onclick(form1) { var form_length = form1.length; var state = check_anyone_checked(form1); if( state == true ) { for( i=0; i<form_length;i++) { if(form1.elements[i].type == 'checkbox') { form1.elements[i].checked = false; form1.allSelect.value="全选"; } } } else { for( i=0; i<form_length;i++) { if(form1.elements[i].type == 'checkbox') { form1.elements[i].checked = true; form1.allSelect.value="清除所有选择项"; } } } } </script><script language="javascript" type="text/javascript"> function check_anyone_checked(form1) { var form_length = form1.length; var state = false; if( form_length >0 ) { for( i=0; i<form_length;i++) { if(form1.elements[i].type == 'checkbox') { if(form1.elements[i].checked == true) { state = true; } } } if(state==true) form1.allSelect.value="清除所有选择项"; else form1.allSelect.value="全选"; return state; } else { alert('无记录'); } } function btn_select_all_onclick(form1) { var form_length = form1.length; var state = check_anyone_checked(form1); if( state == true ) { for( i=0; i<form_length;i++) { if(form1.elements[i].type == 'checkbox') { form1.elements[i].checked = false; form1.allSelect.value="全选"; } } } else { for( i=0; i<form_length;i++) { if(form1.elements[i].type == 'checkbox') { form1.elements[i].checked = true; form1.allSelect.value="清除所有选择项"; } } } } </script>
实现全选
最新推荐文章于 2022-11-26 18:34:39 发布