2007-10-26
DHTML checkbox 选择的几种应用方法
关键字: DHTML,checkbox,选择,应用,方法,全选,全不选,是否有选择js 代码
- //==================================================================================
- // Copyright (c) 1998-2007 by www.bizservice.com.cn, All rights reserved.
- // Email:contact@bizservice.com.cn, HangZhou, China
- //
- // This software is the confidential and proprietary information of
- // Bizservice.Com.Cn. ("Confidential Information"). You shall not disclose
- // such Confidential Information and shall use it only in accordance
- // with the terms of the license agreement you entered into with Bizservice.Com.Cn.
- //==================================================================================
- // Author: Wilson Lin
- // Date: 2004-6-15 14:19:50
- // Description:
- // 无
- // Function List:
- // 1. 无
- // History:
- // 1. 无
- //==================================================================================
- // 全选
- function checkAll(form) {
- for (var i=0; i
- var e = form.elements[i];
- if (e.type=="checkbox")
- e.checked = true ;
- }
- }
- // 全不选
- function checkNotAll(form) {
- for (var i=0; i
- var e = form.elements[i];
- if (e.type=="checkbox")
- e.checked = false ;
- }
- }
- // 是否有选中的项
- function isChecked(form){
- for (var i=0; i
- var e = form.elements[i];
- if (e.type=="checkbox"){
- if(e.checked){
- return true;
- }
- }
- }
- return false;
- }
- 11:06
- 浏览 (416)
- 评论 (2)
- 分类: 软件程式-JavaScript
- 进入论坛
- 相关推荐
评论
congpeixue
2008-04-17
function doFlgCheckedCheck() {
if (document.mainForm.checkFlgArray != undefined) {
var len = document.mainForm.checkFlgArray.length;
var checkedCnt = 0;
if (len > 1){
for (var i = 0; i < len; i++){
if (document.mainForm.checkFlg[i].checked == true){
checkedCnt++;
}
if (checkedCnt < 1){
document.mainForm.document.mainForm.checkFlg[0].checked = true;
showAlert(SY001MCE0038);
return false;
}
}
} else {
if (document.mainForm.checkFlg.checked == true){
checkedCnt++;
}
if (checkedCnt < 1){
document.mainForm.document.mainForm.checkFlg.checked = true;
showAlert(SY001MCE0038);
return false;
}
}
}
return true;
}
if (document.mainForm.checkFlgArray != undefined) {
var len = document.mainForm.checkFlgArray.length;
var checkedCnt = 0;
if (len > 1){
for (var i = 0; i < len; i++){
if (document.mainForm.checkFlg[i].checked == true){
checkedCnt++;
}
if (checkedCnt < 1){
document.mainForm.document.mainForm.checkFlg[0].checked = true;
showAlert(SY001MCE0038);
return false;
}
}
} else {
if (document.mainForm.checkFlg.checked == true){
checkedCnt++;
}
if (checkedCnt < 1){
document.mainForm.document.mainForm.checkFlg.checked = true;
showAlert(SY001MCE0038);
return false;
}
}
}
return true;
}
i_love_sc
2007-10-26
就这几行破代码还加个版权,哎。
发表评论
提醒: 该博客已发表在公共论坛,博客所有留言会成为论坛回贴,留言请注意遵守论坛发贴规则
- 浏览: 7634 次
- 来自: 浙江杭州

- 详细资料
搜索本博客
最近加入圈子
最新评论
-
DHTML checkbox 选择的几 ...
function doFlgCheckedCheck() { if (docu ...
-- by congpeixue -
DHTML checkbox 选择的几 ...
就这几行破代码还加个版权,哎。
-- by i_love_sc






评论排行榜