<%@ page language="java" import="java.util.*" pageEncoding="GBK"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<SCRIPT LANGUAGE="JavaScript">
function checkAll(e,itemName){ //全选函数 e为全选对象,itemName 为子name
var aa=document.getElementsByName(itemName);
for(var i=0;i<aa.length;i++){
aa[i].checked=e.checked;
}
}
function checkItem(e,allName){ //当选取或取消选取没一个复选框时调用的函数
var all=document.getElementById(allName); //全选框对象
if(!e.checked){ //如果是取消选取那么全选框就取消选取
all.checked=false;
}
else{ //如果是选取,就要判断其他是否都已经全部选取了
var aa=document.getElementsByName(e.name);
for(var i=0;i<aa.length;i++){
if(!aa[i].checked){//如果有一个没有选上,那么就返回
return;
}
}
all.checked=true;//如果其他都选上了,全选框就要选上
}
}
</script>
<head>
<body>
<div>
<table border=1>
<tr>
<th><input type=checkbox><label for='selectAll'>全选</label></th>
<th>text</th>
</tr>
<tr>
<td><input type=checkbox name='cb'></td>
<td>11111</td>
</tr>
<tr>
<td><input type=checkbox name='cb'
></td>
<td>22222</td>
</tr>
<tr>
<td><input type=checkbox name='cb'
></td>
<td>33333</td>
</tr>
<tr>
<td><input type=checkbox name='cb'
></td>
<td>44444</td>
</tr>
</table>
</div>
</body>
</html> Smilar Posts of Select the list of JS
-
hibernate generic generic DAO
hibernate generic generic DAO
-
Servlet brief introduction
Servlet brief introduction: Servlet is a small application server Are used to complete the B / S architecture, the client requests the response to treatment Platform independence, performance, able to ...
-
First Hibernate Example
Curd a simple example. Source does not contain the dependent libraries, or playing too much of the package. PO object Note: One must have the default constructor 2 non-final modified. Otherwise useles ...
-
Struts2 + hibernate + spring problem user log in
dao layer services layer action jsp user name: Password:
-
Hibernate secondary cache
Hibernate cache: 2-bit cache, also known as process-level cache or SessionFactory level cache, secondary cache can be shared by all of the session Cache configuration and the use of: Will echcache.xml ...
-
Hibernate's lazy strategy
hibernate Lazy strategy can be used in: tag, it can be true / false Tags can values true / false type of necessary tools to enhance can tag values true / false / extra can be single-ended cor ...







