js实现全选与反选
来源:互联网 发布:逆袭网络剧第一集腾讯 编辑:程序博客网 时间:2024/05/22 06:36
<script type="text/javascript"> function ckbCheckAll() { var ckbAll = document.getElementsByName("checkone"); //alert(ckbAll.length); var ckbMarkAll = document.getElementById("all"); var intIndex = 0; for (intIndex = 0; intIndex < ckbAll.length; intIndex++) { if (ckbMarkAll.checked) { ckbAll[intIndex].checked = true; } else { ckbAll[intIndex].checked = false; } } }</script>
<table cellpadding="1" cellspacing="1" style="width:500px; background:#cccccc;" > <tr style="background-color:#ffffff"> <th><input type="checkbox" onclick="ckbCheckAll()" id="all" /></th> <th style="width:100px">序列号</th> <th style="width:250px">标题</th> <th style="width:100px">时间</th> </tr> <asp:Repeater ID="rptinfo" runat="server"> <ItemTemplate> <tr style="background-color:#ffffff"> <td align="center"><input type="checkbox" name="checkone"/></td> <td align="center"><%#Eval("id") %></td> <td align="center"><%#Eval("Title") %></td> <td align="center"><%#Eval("senddate","{0:yyyy-MM-dd}") %></td> </tr> </ItemTemplate> </asp:Repeater></table>
如果想在后台获取选中项就接着看下去
string sss = Request.Form["checkone"];Response.Write(sss);
当然,你需要在ispostback那里判断是否是第一次加载,否则不管你怎么弄都获取不到checkbox的值
- js实现全选与反选
- js实现全选与反选
- Js实现全选与反选功能
- js实现全选与反选
- js实现全选与反选
- js实现CkeckBox全选与反选
- js实现全选反选
- js实现全选反选
- js实现全选反选
- js实现全选、反选
- js全选与反选
- 原生JS实现全选与反选和jquery全选与反选
- 实现全选与反选
- js实现复选框的全选与反选
- js实现复选框的全选与反选
- 使用js实现checkbox的全选与反选功能
- js实现全选、反选、不选
- JS实现全选、不选、反选
- 因特尔SSE指令教程
- SQL 优化原则
- Oracle树查询
- 如何在C++中调用DLL
- static_cast
- js实现全选与反选
- WINDOWS读写锁的简单实现
- Android Camera HAL设计初步
- 谷歌技术"三宝"之MapReduce
- android 界面布局总结 && Android开发之Linkify【转】
- 获取xen客户机的数据
- gcc编译优化等级的区别
- python2.7.2的安装
- Linux 文件处理命令 总结