- 浏览: 63769 次
- 性别:
- 来自: 深圳
文章分类
最新评论
-
zhangheng54321:
[b][/b][i][/i][u][/u]引用 ...
基于HTTP协议的轻量级开源简单队列服务:HTTPSQS -
relic6:
十分感谢。。rhel5成功yum了!!
RHEL5配置YUM源
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title> New Document </title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<script language="JavaScript">
<!--
var ii = 0;
function boxnum(){
var box = document.getElementsByName("c");
for(var i=0;i<box.length;i++){
box[i].onclick = function chk(){
if(this.checked && ii <= 5) ii += 1;
if(! this.checked) ii -= 1;
if(ii>5){ ii -=1; this.checked = false;alert('最多不能超多5个主营项目!请重新选择!');}
}
}
}
window.onload = boxnum;
//-->
</script>
</head>
<body>
<table cellspacing="0" border="1" width="200" >
<tr>
<td><input type="checkbox" name="c"></td>
<td><input type="checkbox" name="c"></td>
<td><input type="checkbox" name="c"></td>
</tr>
<tr>
<td><input type="checkbox" name="c"></td>
<td><input type="checkbox" name="c"></td>
<td><input type="checkbox" name="c"></td>
</tr>
</body>
</html>
第二种方法
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script>
function boxnum(obj){
}
function checknum(){
var e,srcE
e=window.event?window.event:e;
srcE=e.srcElement?e.srcElement:e.target;
if(!srcE)return;
if(String(srcE.tagName).toLowerCase()!="input"||String(srcE.type).toLowerCase()!="checkbox")return;
var box = document.form1.elements['checkbox3'];
var ii = 0
for(var i=0;i<box.length;i++){
if(box[i].checked){ii++;}
}
if(ii>5){
alert('最多不能超多5个主营项目!请重新选择!');
srcE.checked=false;
}
}
document.onkeydown=document.onchange=document.onclick=checknum;
</script>
</head>
<body>
<form id="form1" name="form1" method="post" action="">
<table width="520" height="221" border="1">
<tr>
<td><label>
<input type="checkbox" name="checkbox3" value="checkboxa" />
1
<input type="checkbox" name="checkbox3" value="checkboxaa" />
2
<input type="checkbox" name="checkbox3" value="checkboxaaa" />
3
<input type="checkbox" name="checkbox3" value="checkboxaaaa" />
4
<input type="checkbox" name="checkbox3" value="checkboxcv" />
5
<input type="checkbox" name="checkbox3" value="checkboxcvb" />
6
<input type="checkbox" name="checkbox3" value="checkboxcvbcvb" />
7
<input type="checkbox" name="checkbox3" value="checkboxcvbcvbcv" />
8
<input type="checkbox" name="checkbox3" value="checcvb" />
9
<input type="checkbox" name="checkbox3" value="checvb" />
10
<input type="checkbox" name="checkbox3" value="chcvbox" />
<input type="checkbox" name="checkbox3" value="chcvbcvbox" />
<input type="checkbox" name="checkbox3" value="ccvbcvbcvox" />
</label></td>
<td> </td>
<td> </td>
</tr>
<tr>
<td><input type="button" name="Submit" value="按钮" onclick="boxnum('checkbox3')" /></td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
</form>
</body>
</html>
第三种方法
<form method="post" action="" name="form1" id="form1">
<input type="checkbox" name="a" />
<input type="checkbox" name="a" />
<input type="checkbox" name="a" />
<input type="checkbox" name="a" />
<input type="checkbox" name="a" />
<input type="checkbox" name="a" />
<input type="checkbox" name="a" />
<input type="checkbox" name="a" />
<input type="checkbox" name="a" />
</form>
<script language="javascript" type="text/javascript">
var m_count = 0;
document.getElementById("form1").onclick = function(e){
ele = (document.all)?window.event.srcElement:e.target;
if (ele.nodeName.toLowerCase()=="input" && ele.type.toLowerCase()=="checkbox" && ele.checked)
m_count++;
if (ele.nodeName.toLowerCase()=="input" && ele.type.toLowerCase()=="checkbox" && !ele.checked)
m_count--;
if(m_count>5){
m_count--;
alert("最多不能超多5个主营项目!");
return false;
}
return true;
}
</script>
protected void chkAll_CheckedChanged(object sender, EventArgs e)
{
try
{
foreach (Control ctrl in Page.Form.Controls)
{
if (ctrl is System.Web.UI.WebControls.CheckBox)
{
((CheckBox)ctrl).Checked = chkAll.Checked;
}
}
}
catch (Exception ex)
{
throw ex;
}
}
var isChecked=true
function chALl()
{
o = document.getElementsByTagName("INPUT")
for(i=0;i<o.length;i++)
if(o[i].type=="checkbox") o[i].checked=isChecked
isChecked=!isChecked
}
本文出处,http://www.cnblogs.com/hqbird/archive/2008/10/13/1309636.html
<html>
<head>
<title> New Document </title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<script language="JavaScript">
<!--
var ii = 0;
function boxnum(){
var box = document.getElementsByName("c");
for(var i=0;i<box.length;i++){
box[i].onclick = function chk(){
if(this.checked && ii <= 5) ii += 1;
if(! this.checked) ii -= 1;
if(ii>5){ ii -=1; this.checked = false;alert('最多不能超多5个主营项目!请重新选择!');}
}
}
}
window.onload = boxnum;
//-->
</script>
</head>
<body>
<table cellspacing="0" border="1" width="200" >
<tr>
<td><input type="checkbox" name="c"></td>
<td><input type="checkbox" name="c"></td>
<td><input type="checkbox" name="c"></td>
</tr>
<tr>
<td><input type="checkbox" name="c"></td>
<td><input type="checkbox" name="c"></td>
<td><input type="checkbox" name="c"></td>
</tr>
</body>
</html>
第二种方法
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script>
function boxnum(obj){
}
function checknum(){
var e,srcE
e=window.event?window.event:e;
srcE=e.srcElement?e.srcElement:e.target;
if(!srcE)return;
if(String(srcE.tagName).toLowerCase()!="input"||String(srcE.type).toLowerCase()!="checkbox")return;
var box = document.form1.elements['checkbox3'];
var ii = 0
for(var i=0;i<box.length;i++){
if(box[i].checked){ii++;}
}
if(ii>5){
alert('最多不能超多5个主营项目!请重新选择!');
srcE.checked=false;
}
}
document.onkeydown=document.onchange=document.onclick=checknum;
</script>
</head>
<body>
<form id="form1" name="form1" method="post" action="">
<table width="520" height="221" border="1">
<tr>
<td><label>
<input type="checkbox" name="checkbox3" value="checkboxa" />
1
<input type="checkbox" name="checkbox3" value="checkboxaa" />
2
<input type="checkbox" name="checkbox3" value="checkboxaaa" />
3
<input type="checkbox" name="checkbox3" value="checkboxaaaa" />
4
<input type="checkbox" name="checkbox3" value="checkboxcv" />
5
<input type="checkbox" name="checkbox3" value="checkboxcvb" />
6
<input type="checkbox" name="checkbox3" value="checkboxcvbcvb" />
7
<input type="checkbox" name="checkbox3" value="checkboxcvbcvbcv" />
8
<input type="checkbox" name="checkbox3" value="checcvb" />
9
<input type="checkbox" name="checkbox3" value="checvb" />
10
<input type="checkbox" name="checkbox3" value="chcvbox" />
<input type="checkbox" name="checkbox3" value="chcvbcvbox" />
<input type="checkbox" name="checkbox3" value="ccvbcvbcvox" />
</label></td>
<td> </td>
<td> </td>
</tr>
<tr>
<td><input type="button" name="Submit" value="按钮" onclick="boxnum('checkbox3')" /></td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
</form>
</body>
</html>
第三种方法
<form method="post" action="" name="form1" id="form1">
<input type="checkbox" name="a" />
<input type="checkbox" name="a" />
<input type="checkbox" name="a" />
<input type="checkbox" name="a" />
<input type="checkbox" name="a" />
<input type="checkbox" name="a" />
<input type="checkbox" name="a" />
<input type="checkbox" name="a" />
<input type="checkbox" name="a" />
</form>
<script language="javascript" type="text/javascript">
var m_count = 0;
document.getElementById("form1").onclick = function(e){
ele = (document.all)?window.event.srcElement:e.target;
if (ele.nodeName.toLowerCase()=="input" && ele.type.toLowerCase()=="checkbox" && ele.checked)
m_count++;
if (ele.nodeName.toLowerCase()=="input" && ele.type.toLowerCase()=="checkbox" && !ele.checked)
m_count--;
if(m_count>5){
m_count--;
alert("最多不能超多5个主营项目!");
return false;
}
return true;
}
</script>
protected void chkAll_CheckedChanged(object sender, EventArgs e)
{
try
{
foreach (Control ctrl in Page.Form.Controls)
{
if (ctrl is System.Web.UI.WebControls.CheckBox)
{
((CheckBox)ctrl).Checked = chkAll.Checked;
}
}
}
catch (Exception ex)
{
throw ex;
}
}
var isChecked=true
function chALl()
{
o = document.getElementsByTagName("INPUT")
for(i=0;i<o.length;i++)
if(o[i].type=="checkbox") o[i].checked=isChecked
isChecked=!isChecked
}
本文出处,http://www.cnblogs.com/hqbird/archive/2008/10/13/1309636.html
发表评论
-
五种常见的 PHP 设计模式
2011-05-11 09:18 633http://www.ibm.com/developerwor ... -
谈技术人员研究方向
2011-04-02 11:12 820(转载) http://timyang.net/categor ... -
做卓有成效的程序员
2011-04-02 11:03 771(转载)http://timyang.net/misc/pro ... -
web2.0图形设计样式指南
2010-05-07 17:20 682http://bbs.mycgs.cn/viewthread. ... -
Discuz!全局变量列表
2010-05-06 13:15 1723http://blog.fufuok.com/Article/ ... -
深入理解C语言指针的奥秘
2010-04-30 17:44 668来源:http://community.csdn.net/Ex ... -
字符,字节和编码
2010-04-30 17:40 658本文来自 http://blog.csdn.n ... -
推荐介绍几款小巧的Web Server程序
2010-04-30 17:37 1639本文来自 http://blog.csdn.n ... -
Linux字符集的修改方法
2010-04-27 12:17 1367用export LANG=zh_CN.UTF-8这样只下次重起 ... -
yum来安装lamp 实站
2010-04-27 10:25 1105apache yum install httpd httpd- ... -
apache2+PHP4.4.1+Mysql4.1.18+GD2+ZendOptimizer (原创)
2010-04-24 13:01 1548apache2+PHP4.4.1+Mysql4.1.18+GD ... -
CentOS 关闭 SELinux
2010-04-23 10:41 5585方法1 使用文本编辑工具打开 /etc/selinux/con ... -
rhel 使用 centos yum 源 实站
2010-04-22 14:23 1378wget centos.ustc.edu.cn/CentOS- ... -
中国科技大学 yum 源
2010-04-22 13:54 1908rpm --import http://mirrors.shl ... -
RHEL 5的yum源的设置
2010-04-22 11:11 1820RHEL 5的yum源的设置 我们市面上买的rhel好多是盗版 ... -
Windows下的Memcache安装
2010-04-22 09:46 2431Windows下的Memcache安装 很多phper不知道如 ... -
RHEL5配置YUM源
2010-04-21 16:27 2329RHEL5 配置YUM源 cd /etc/yum.rep ... -
RedHat 5.3配置YUM 从centos5源与光盘源更新软件
2010-04-20 15:22 2296YUM顾名思义,Yellow Dog Up ... -
mysql 常用命令集合
2010-04-16 08:45 9301、MySQL常用命令 oracle create d ... -
JS的正则表达式
2010-04-15 14:20 610JS的正则表达式 //校验是否全由数字组成 代码 fu ...
相关推荐
WPF CheckBox WPF CheckBox多选的应用
纯angularjs实现的checkbox多选、全选、反选的例子,不依赖源数据,不会对源数据造成任何污染。
listview+checkbox 多选
CheckBox多选功能的实现 ListView与CheckBox CheckBox多选功能的实现 ListView与CheckBox
jS checkbox 多选 两中方法:一个是ifream下 一种是cookie
jquery checkbox 选中 取消 checkbox多选
radiobutton 控制checkbox多选(js实现)
Checkbox多选全选
每个listview的每条item中都有多个checkbox,在项目中需要用到,所以写了个小demo,可以判断每个item中哪些checkbox被选中了。
通过在GridView中CheckBox多选的批量删除,绝对经典哦哦
html checkbox cash 表单提交checkbox 多选
checkbox多选
该资源主要应用于layui框架下table表格渲染后判断checkbox多选控件是否可用,当然done下还可以做其他逻辑判定,附上源码,绝对可用。
JQuery带checkbox多选的下拉列表,功能非常强大,浏览器兼容性也很强, 浏览器兼容性如下: IE 7+ Chrome 8+ Firefox 10+ Safari 3+ Opera 10.6+ 调用非常强大,扩展性也很强
一个listview + checkbox 的多选反选取消的demo
listview实现checkbox多选效果,可动态加载数据,完美融合.rar,太多无法一一验证是否可用,程序如果跑不起来需要自调,部分代码功能进行参考学习。
最近在做关于伸缩列表这块功能,在网上找了许多关于ExpandableListView+CheckBox的例子,不是代码比较臃肿,就是写法混乱,都没什么参考意义,所以动手写了个简洁易懂的Demo.
在网页中很多时候会用到CheckBoX的多选和反选.比如网上调查或是后台管理系统等。现在主流的方法是用JavaScript来实现CheckBOX的多选和反选,下面笔者就为大家介绍一下如何实现这样的网页效果
自制checkbox组件,直接使用,可在源码修改
listview +checkbox 实现单选、多选操作