【CheckBox】选择或取消所有CheckBox
2008-04-09 15:39
330 查看
<SCRIPT LANGUAGE="JavaScript">
<!--
// This script checks and unchecks boxes on a form
// Checks and unchecks unlimited number in the group
// Pass the Checkbox group name
// call buttons as so:
// <input type=button name="CheckAll" value="Check All"
//onClick="checkAll(this)">
// <input type=button name="UnCheckAll" value="Uncheck All"
//onClick="uncheckAll(this)">
// -->
<!-- Begin
function checkAll(theElement) {
var theForm = theElement.form, z = 0;
for(z=0; z<theForm.length;z++){
if(theForm[z].type == 'checkbox'){
theForm[z].checked = true;
}
}
}
function uncheckAll(theElement) {
var theForm = theElement.form, z = 0;
for(z=0; z<theForm.length;z++){
if(theForm[z].type == 'checkbox'){
theForm[z].checked = false;
}
}
}
// End -->
</script>
Your Favorite Scripts & Languages
Java
Javascript
Active Server Pages
HTML
SQL
<!--
// This script checks and unchecks boxes on a form
// Checks and unchecks unlimited number in the group
// Pass the Checkbox group name
// call buttons as so:
// <input type=button name="CheckAll" value="Check All"
//onClick="checkAll(this)">
// <input type=button name="UnCheckAll" value="Uncheck All"
//onClick="uncheckAll(this)">
// -->
<!-- Begin
function checkAll(theElement) {
var theForm = theElement.form, z = 0;
for(z=0; z<theForm.length;z++){
if(theForm[z].type == 'checkbox'){
theForm[z].checked = true;
}
}
}
function uncheckAll(theElement) {
var theForm = theElement.form, z = 0;
for(z=0; z<theForm.length;z++){
if(theForm[z].type == 'checkbox'){
theForm[z].checked = false;
}
}
}
// End -->
</script>
Your Favorite Scripts & Languages
Java
Javascript
Active Server Pages
HTML
SQL
相关文章推荐
- easyui combotree 实现勾选checkbox 同时选择所有子节点,取消父节点同时取消所有子节点
- CheckBox为CheckBoxList实现全选或全取消选择(js代码实现)
- android+checkbox全选多选反选取消选择
- GridView 中的checkbox加上选择所有的功能
- JS控制HTML取消所有Radio的选择,并不可选择。
- checkbox中,根据获取的文字,如果有互斥选项,提示并取消最后选择的一个选项的实现
- asp.net TreeView安装、使用(如何将TreeView打包发布)(带CheckBox选择框的TreeView的初始化,TreeView客户端操作:选择父节点后自动选择所有子节点,子节点选择后自动选择父节点)(TreeView节点精确定位)
- jquery实现checkbox全选,反选,取消选择
- JS 某一区域内所有CheckBox全选和取消全选(.net)
- checkbox全选/取消/选中所有奇数/反选/获得选中的值
- JS (CheckBox)选择与取消代码
- Form中的CheckBox的全部选择与全部取消
- 选择所有checkbox
- jquery 选择 取消 checkbox
- asp.net TreeView安装、使用(如何将TreeView打包发布)(带CheckBox选择框的TreeView的初始化,TreeView客户端操作:选择父节点后自动选择所有子节点,子节点选择后自动选择父节点)(TreeView节点精确定位)2005-12-23更新
- javascript, jquery实现checkbox全选,反选,取消选择
- ASP.NET 2.0 TreeView中用JavaScript实现选择子接点CheckBox是自动选择上父节点(或者所有父节点)
- CheckBox为CheckBoxList实现全选或全取消选择
- 对CHECKBOX的 全选,全取消,反向选择