<%@ Page Language="java" contentType="text/html; Charset=utf-8 "
pageencoding="UTF-8"%>
<%@ include file="/commons/jsp/htmtag.jsp"%>
<meta http-equiv= "content-type" Content="text/html; Charset=utf-8 ">
<title></title>
<script>
When the Select All button is selected, all check boxes are selected, and when the Select All button is not selected, all are not selected.
functionFunselall(){
VarSelects=Document.Getelementsbyname("Selone");
If(Document.Getelementsbyname("Selall")[0].Checked==True){
For(VarI=0;I<Selects.Length;I++){
Selects[I].Checked=True;
}
}Else{
For(VarI=0;I<Selects.Length;I++){
Selects[I].Checked=False;
}
}
}
When all checkboxes are selected, the Select All button is selected, and when any or more of them are not selected, the Select All button is not selected
functionFunselone(){
VarOne=Document.Getelementsbyname("Selone");
VarAll=Document.Getelementsbyname("Selall")[0]
VarSelcount=0;
VarUnselcount=0;
For(VarI=0;I<One.Length;I++){
If(One[I].Checked==True){
Selcount++;
}
If(One[I].Checked==False){
Unselcount++;
}
if (selcount==one< Span class= "pun". length) {
all. Checked=true }
if ( unselcount>0) {
all.=false }
}
}
functionFundelbatch(){
VarStrsvalue="";
VarSTRs=Document.Getelementsbyname("Selone");
If(STRs!=Null&&STRs.Length>0){
For(VarI=0; I<strs.; I++) {
//----
if ( strs[i]. Checked==true) {
strsvalue =strsvalue+strs[< Span class= "PLN" >i. value+
//---
}
}
Document.Form1.Action="<%=request.getcontextpath ()%>/grade/allgrades.htm?method=todetailgradebatch&gradeids="+Strsvalue;
Document.Form1.Submit();
}
</script>
<body>
<!--todetailgradebyname-->
<form action= "<%=Request.Getcontextpath()%>/grade/allgrades.htm?method=todetailgradebyname "method=" Post "id=" Form1 "Name=" Form1 ">
<div Align="Center">
<input type= "text" name= "gradename" value= "${gradename}" >
<input type= "submit" value = "query" >
<input type= "reset" value= "reset" >
<br/
<br/>
<input Type="Button" Value=Add OnClick="Window.Open(' Http://localhost:8080/demo/jsp/grade/gradeAdd.jsp ');">
<input Type="Button" Value="Bulk Delete" OnClick="Fundelbatch()">
</div>
<table Border="1px"Align="Center" Border="1" cellpadding="2" CellSpacing="0" Bordercolorlight="#000000" Bordercolordark="#FFFFFF" BgColor="#FFFFEE">
<c:if Test="${not Empty ' ${volists} '}">
<tr>
<td><input Type="checkbox" Name="Selall" OnClick="Funselall(This)"></td>
<td>Class Code</td>
<td>Class name</td>
<td>Operation</td>
</tr>
<c:foreach Items="${volists}" Var="Vo">
<tr>
<td><input Type="checkbox" Name="Selone" Value="${vo.gradeid}" OnClick="Funselone(This)"></td>
<td>${vo.gradeid}</td>
<td>${vo.gradename}</TD>
<TD>
<a href= " <%=request. () %>/grade/allgrades.htm?method=todeletegrade&gradeid =${vo.gradeid} "> Delete </A>
<a href=" <%=< Span class= "PLN" >request. () %>/grade/allgrades.htm?method=todetailgrade&gradeid =${vo.gradeid} "> Modify </A>
</TD>
</ Tr>
</C:FOREACH>
</C:IF>
</ Table>
</FORM>
</body>
Html,javascript How to control the check box checkbox of the full selection, all unselected, and all selected, select All buttons, one or more of the unselected, the Select All button is not selected