zoukankan
html css js c++ java
脚本实现CheckBox父选中,子全选中,子选中父也选中!
<
FORM
id
=weaver
name
=frmmain
action
="DocUserDefaultOperation.jsp"
method
=post
>
<
input
type
="hidden"
name
="id"
value
=1
>
<
table
class
=Form
>
<
tr
class
=Section
>
<
TH
colSpan
=2
>
字段
</
TH
>
</
tr
>
<
TR
class
=Separator
>
<
TD
class
=Sep1
colSpan
=2
></
TD
>
</
TR
>
<
tr
class
=field
>
<
td
width
="50%"
>
<
input
type
="checkbox"
name
="hascreater"
value
="1"
checked
>
所有者
</
td
>
<
td
width
="50%"
>
<
input
type
="checkbox"
name
="hasdocid"
value
="1"
checked
>
标识
</
td
>
</
tr
>
<
tr
class
=field
>
<
td
width
="50%"
>
<
input
type
="checkbox"
name
="hascreatedate"
value
="1"
checked
>
创建日期
</
td
>
<
td
width
="50%"
>
<
input
type
="checkbox"
name
="hascategory"
value
="1"
checked
>
主目录/分目录/子目录
</
td
>
</
tr
>
<
tr
class
=field
>
<
td
width
="50%"
>
<
input
type
="checkbox"
name
="hascreatetime"
value
="1"
checked
>
修改日期时间
</
td
>
<
td
width
="50%"
>
<
input
type
="checkbox"
name
="hasreplycount"
value
="1"
checked
>
显示回复总数
</
td
>
</
tr
>
<
tr
class
=field
>
<
td
width
="50%"
>
</
td
>
<
td
width
="50%"
>
<
input
type
="checkbox"
name
="hasaccessorycount"
value
="1"
checked
>
显示附件总数
</
td
>
</
tr
>
<
tr
class
=Section
>
<
TH
colSpan
=2
>
显示
</
TH
>
</
tr
>
<
TR
class
=Separator
>
<
TD
class
=Sep1
colSpan
=2
></
TD
>
</
TR
>
<
tr
class
=field
>
<
td
>
每页记录
<
input
type
="text"
class
=saveHistory
name
="numperpage"
value
=50
size
="3"
maxlength
=2
onKeyPress
="ItemCount_KeyPress()"
onBlur
='checknumber1(this)'
>
条
</
td
>
</
tr
>
<
tr
class
=Section
>
<
TH
colSpan
=2
>
主目录 - 目录
</
TH
>
</
tr
>
<
TR
class
=Separator
>
<
TD
class
=Sep1
colSpan
=2
></
TD
>
</
TR
>
<
tr
>
<
td
width
="50"
>
主目录
</
td
>
<
td
width
="50%"
></
td
>
</
tr
>
<
tr
>
<
td
width
="50%"
align
="center"
>
分目录
</
td
>
<
td
width
="50%"
></
td
>
</
tr
>
<
tr
><
td
colspan
=2
></
td
></
tr
>
<
TR
><
TD
class
=Sep1
colSpan
=2
></
TD
></
TR
>
<
tr
class
=field
>
<
td
width
="50%"
align
=left
valign
=top
>
<
table
class
=Form
>
<
tr
class
=field
>
<
td
colspan
=2
align
=left
>
<
input
type
="checkbox"
name
="m12"
value
="M12"
onclick
="checkMain('12')"
checked
>
<
b
>
系统使用
</
b
>
</
td
></
tr
>
<
tr
class
="field"
>
<
td
width
="20%"
></
td
>
<
td
>
<
input
type
="checkbox"
name
="s12"
value
="S27"
onclick
="checkSub('12')"
checked
>
系统使用规范
</
td
></
tr
>
<
tr
class
="field"
>
<
td
width
="20%"
></
td
>
<
td
>
<
input
type
="checkbox"
name
="s12"
value
="S28"
onclick
="checkSub('12')"
checked
>
系统功能介绍
</
td
></
tr
>
</
table
>
<
table
class
=Form
>
<
tr
class
=field
>
<
td
colspan
=2
align
=left
>
<
input
type
="checkbox"
name
="m7"
value
="M7"
onclick
="checkMain('7')"
checked
>
<
b
>
会议资料
</
b
>
</
td
></
tr
>
<
tr
class
="field"
>
<
td
width
="20%"
></
td
>
<
td
>
<
input
type
="checkbox"
name
="s7"
value
="S12"
onclick
="checkSub('7')"
checked
>
会议资料
</
td
></
tr
>
</
table
>
</
td
><
td
align
=left
valign
=top
>
</
tr
>
</
table
>
</
form
>
<
script
>
function
checkMain(id)
{
len
=
document.frmmain.elements.length;
var
mainchecked
=
document.all(
"
m
"
+
id).checked ;
var
i
=
0
;
for
( i
=
0
; i
<
len; i
++
)
{
if
(document.frmmain.elements[i].name
==
's'
+
id)
{
document.frmmain.elements[i].checked
=
mainchecked ;
}
}
}
function
checkSub(id)
{
len
=
document.frmmain.elements.length;
var
i
=
0
;
for
( i
=
0
; i
<
len; i
++
)
{
if
(document.frmmain.elements[i].name
==
's'
+
id)
{
if
(document.frmmain.elements[i].checked)
{
document.all(
"
m
"
+
id).checked
=
true
;
return
;
}
}
}
document.all(
"
m
"
+
id).checked
=
false
;
}
function
onSave()
{
if
(document.all(
"
numperpage
"
).value
!=
""
&&
document.all(
"
numperpage
"
).value
*
1
<=
0
)
{
alert(
"
每页记录条数必须大于零
"
);
return
;
}
frmmain.submit();
}
</
script
>
查看全文
相关阅读:
windows 将常用程序添加到右键菜单中去
用MediaPlayer播放assets中的音乐文件出现的问题
android开发技巧
windows下如何安装java6.0
ubuntu下运行windows程序wine
ubuntu系统备份与恢复
Mongo北京大会3月3号召开!报名抢注火爆进行中!(免费)
《人月神话》作者Frederick P. Brooks, Jr.大师论设计原本
HTML 5:富媒体时代的Web内容新规范
2011年3月华章新书书讯:ASP.NET本质论、Erlang编程指南、SNS网站构建
原文地址:https://www.cnblogs.com/anson/p/385986.html
最新文章
TreeView Node Value中包含/, 导致获取值不正常
关于asp.net的中绑定名称的大小写问题.
开发VS2005下ComboBoxTreeView(下拉列表框弹出树) 与ToolStripComboBoxTreeView(下拉列表框工具条弹出树) (转)
asp.net 中, command事件 和click事件的触发顺序.
Asp.net 2.0 中, 无法获取TreeView控件的SelectedValue
Active record 中如何执行多对多的关联查询?
CentOS搭建SVN(CollabNet Subversion)服务器
Maven配置之settings.xml
Maven配置之pom.xml(一)
MultiActionController中的处理方法映射
热门文章
Maven环境搭建
Maven配置之pom.xml(二)
Spring加载配置文件的方式
MyEclipse中JadClipse插件
几种流行Webservice框架性能对比
pycharm安装及配置全过程
浏览器护眼色设置
线程间通信
WIN7系统文件夹上的小锁图标取消方法(转)
Ubuntu显示隐藏文件和文件夹
Copyright © 2011-2022 走看看