<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script src="jquery.min.js"></script>
</head>
<body>
<form id='myForm' name="myForm" method="post" action="test6.php">
<input type="checkbox" id='all' >:全部</input> <input type="checkbox" class="list" name='list[]' value="1" >:1</input>

         <input type="checkbox" class="list" name='list[]' value="2" >:2</input>
         <input type="checkbox" class="list" name='list[]' value="3" >:3</input>

        <br/>
<br/>
<select name="select">
<option>1</option>
<option>2</option>
<option>3</option>
</select>
<input type="button" id="but" value="sub"></input>
<input type="submit" id="but" value="sub12"></input>
</form>
</body>
</html>
<script type="text/javascript">
$(document).ready(function($) {
$("#all").click(function(event) {
if($('#all').prop('checked')){
$('.list').prop('checked',true);
}else{
$('.list').prop('checked',false);
}
});
$(".list").click(function(event) {
var arr_stu = [];
$('.list').each(function(index, el) {
var statu = $(this).prop('checked');
arr_stu.push(statu);
});
$.unique(arr_stu).length==1?$('#all').prop('checked',true):$('#all').prop('checked',false);
}); $('#but').click(function(){
var data = $('#myForm').serialize();
$.ajax({
url: 'test6.php',
type: 'post',
dataType: 'json',
data: data,
success:function(result){ }
}) })
});
</script>

多选checkbox的更多相关文章

  1. ztree点击文字勾选checkbox,radio实现方法

    ztree的复选框checkbok,单选框radio是用背景图片来模拟的,所以点击文字即使用label括起checkbox,radio文字一起,点击文字也是无法勾选checkbox. 要想点击ztre ...

  2. zTree 勾选checkbox

    zTree 勾选checkbox var setting = {    check: {        enable: true//        chkboxType : { "Y&quo ...

  3. 在ASP.NET MVC中通过勾选checkbox来更改select的内容

    遇到了这样的一个需求:通过勾选checkbox来更改select的内容. 在没有勾选checkbox之前是这样的: 在勾选checkbox之后是这样的: 想通过ajax异步来实现.所以,从控制器拿到的 ...

  4. Uipath 勾选checkbox

    东京IT青年前线 http://www.rpatokyo.com/ Uipath 勾选checkbox 使用check Activity可以对check box 复选框进行勾选. 虽然Click也可以 ...

  5. cocos2dx 3.x (单选,多选,复选checkBox按钮的实现) RadioButton

    // //  LandLordsMakeNewRoom.hpp //  MalaGame39 // //  Created by work on 2016/12/19. // //   #ifndef ...

  6. Android ListView(Selector 背景图片 全选 Checkbox等按钮)

    list_item.xml <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xm ...

  7. js全选checkbox框

    html: <input  type="checkbox" id="checkbox1" value="1" onclick=&quo ...

  8. winform datagridview在添加全选checkbox时提示:不能设置 selected 或 selected 既不是表 Table 的 DataColumn 也不是 DataRelation。

    在项目中,需要多选功能,于是在datagridview添加了一列DataGridViewCheckBoxColumn 在给datagridview绑定完数据集之后,对全选进行操作的时候,发现总报错,报 ...

  9. Jquery 组 checkbox全选checkbox

    <!DOCTYPE html><html lang="zh-cn"><head> <meta charset="utf-8&qu ...

  10. js实现全选checkbox

    js代码 function selectAllCheckBox(parentid) { var PID = document.getElementById(parentid); var cb = PI ...

随机推荐

  1. mongodb的基本操作数据更新

    先启动服务器 查看数据库 选择数据库 删除数据库 插入信息 查看插入的表名 查看信息 修改表数据 修改指定信息,其他信息不改变 可以使不存在的命令进行修改并保存 修改多条数据 删除数据 删除表 查看集 ...

  2. LiveScript 操作符

    The LiveScript Book     The LiveScript Book 操作符 数字 标准的数学操作符: 1.1 + 2 # => 32.3 - 4 # => -13.6 ...

  3. Debian下无root权限使用Python访问Oracle

    这篇文章的起因是,在公司的服务器上没有root权限,但是需要使用 Python 访问 Oracle,而不管是使用 pip 安装组件还是安装 Oracle 的 client,都需要相应权限.本文即解决该 ...

  4. Educational Codeforces Round 36 (Rated for Div. 2)

    A. Garden time limit per test 1 second memory limit per test 256 megabytes input standard input outp ...

  5. poj2135最小费用最大流经典模板题

    Farm Tour Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 13509   Accepted: 5125 Descri ...

  6. Swift 3:新的访问控制fileprivate和open

    在swift 3中新增加了两种访问控制权限 fileprivate和 open.下面将对这两种新增访问控制做详细介绍. fileprivate 在原有的swift中的 private其实并不是真正的私 ...

  7. 【bzoj1941】[Sdoi2010]Hide and Seek KD-tree

    题目描述 小猪iPig在PKU刚上完了无聊的猪性代数课,天资聪慧的iPig被这门对他来说无比简单的课弄得非常寂寞,为了消除寂寞感,他决定和他的好朋友giPi(鸡皮)玩一个更加寂寞的游戏---捉迷藏. ...

  8. BZOJ 3786 星系探索 ——Splay

    子树可以移动,唔. 还是用Splay维护DFS序即可. 子树的话直接截取出来就好了. 然后求前驱后继可能麻烦一些. 添加两个虚拟节点会比较好写. #include <map> #inclu ...

  9. iOS-汉字排序

    * 在IOS开发过程中,排序是我们经常遇到的问题,那么如何进行排序呢? * 在英文状态下,系统中有直接可以调用的方法.    例如:对数组[sss, aaa, bbb, ppp]进行排序,我们可以直接 ...

  10. python中的 __xxx__ 方法

    1 __class__ instance.__class__ The class to which a class instance belongs def foo(): pass class A(o ...