请教一个很墨迹的问题?
是这样的:
后台有这样的一个通过JS对复选框的选中和不选的控制
<tr>
<td class=a4> <strong> <font color= "#0000FF "> 常规管理: </font> </strong> </td>
</tr>
<tr>
<td class=a4> <input name= "boxa1 " type= "checkbox " id= "boxa1 " value= "管理员添加, " <% if instr( ", "&rs( "qx ")& ", ", "管理员添加 ") <> 0 Then Response.Write "checked " End If %> >
1.管理员添加
<input name= "boxa2 " type= "checkbox " id= "boxa2 " value= "管理员管理, " <% if instr( ", "&rs( "qx ")& ", ", "管理员管理 ") <> 0 Then Response.Write "checked " End If %> >
2.管理员管理
<input name= "boxa3 " type= "checkbox " id= "boxa3 " value= "上传设置, " <% if instr( ", "&rs( "qx ")& ", ", "上传设置 ") <> 0 Then Response.Write "checked " End If %> >
3.上传设置
<input name= "boxa4 " type= "checkbox " id= "boxa4 " value= "文件管理, " <% if instr( ", "&rs( "qx ")& ", ", "文件管理 ") <> 0 Then Response.Write "checked " End If %> >
4.文件管理
<input name= "boxa5 " type= "checkbox " id= "boxa5 " value= "省级管理, " <% if instr( ", "&rs( "qx ")& ", ", "省级管理 ") <> 0 Then Response.Write "checked " End If %> >
5.省级管理
<input name= "boxa6 " type= "checkbox " id= "boxa6 " value= "市级管理, " <% if instr( ", "&rs( "qx ")& ", ", "市级管理 ") <> 0 Then Response.Write "checked " End If %> >
6.市级管理
<input name= "boxa7 " type= "checkbox " id= "boxa7 " value= "网站信息, " <% if instr( ", "&rs( "qx ")& ", ", "网站信息 ") <> 0 Then Response.Write "checked " End If %> >
7.网站信息 <br>
<input name= "boxa8 " type= "checkbox " id= "boxa8 " value= "邮件订阅, " <% if instr( ", "&rs( "qx ")& ", ", "邮件订阅 ") <> 0 Then Response.Write "checked " End If %> >
8.邮件订阅
<input name= "boxa9 " type= "checkbox " id= "boxa9 " value= "行业商家, " <% if instr( ", "&rs( "qx ")& ", ", "行业商家 ") <> 0 Then Response.Write "checked " End If %> >
9.行业商家
<input name= "boxa10 " type= "checkbox " id= "boxa10 " value= "区域商家, " <% if instr( ", "&rs( "qx ")& ", ", "区域商家 ") <> 0 Then Response.Write "checked " End If %> >
10.区域商家
<input name= "boxa11 " type= "checkbox " id= "boxa11 " value= "调查管理, " <% if instr( ", "&rs( "qx ")& ", ", "调查管理 ") <> 0 Then Response.Write "checked " End If %> >
11.调查管理
<input name= "boxa12 " type= "checkbox " id= "boxa12 " value= "企业信息, " <% if instr( ", "&rs( "qx ")& ", ", "企业信息 ") <> 0 Then Response.Write "checked " End If %> >
12.企业信息
<input name= "boxa13 " type= "checkbox " id= "boxa13 " value= "企业管理, " <% if instr( ", "&rs( "qx ")& ", ", "企业管理 ") <> 0 Then Response.Write "checked " End If %> >
13.企业管理
<input name= "boxa14 " type= "checkbox " id= "boxa14 " value= "生成HTML, " <% if instr( ", "&rs( "qx ")& ", ", "生成HTML ") <> 0 Then Response.Write "checked " End If %> >
14.生成HTML <br>
<input name= "boxa15 " type= "checkbox " id= "boxa15 " value= "图库管理, " <% if instr( ", "&rs( "qx ")& ", ", "图库管理 ") <> 0 Then Response.Write "checked " End If %> >
15.图库管理 </td>
</tr>
<tr>
<td class=a4> <strong> <font color= "#0000FF "> 广告管理: </font> </strong> </td>
</tr>
<tr>
<td class=a4> <input name= "boxb1 " type= "checkbox " id= "boxb1 " value= "咨询设置, " <% if instr( ", "&rs( "qx ")& ", ", "咨询设置 ") <> 0 Then Response.Write "checked " End If %> >
1.咨询设置 <input name= "boxb2 " type= "checkbox " id= "boxb2 " value= "广告设置, " <% if instr( ", "&rs( "qx ")& ", ", "广告设置 ") <> 0 Then Response.Write "checked " End If %> >
2.广告设置 <input name= "boxb3 " type= "checkbox " id= "boxb3 " value= "广告发布, " <% if instr( ", "&rs( "qx ")& ", ", "广告发布 ") <> 0 Then Response.Write "checked " End If %> >
3.广告发布 <input name= "boxb4 " type= "checkbox " id= "boxb4 " value= "广告管理, " <% if instr( ", "&rs( "qx ")& ", ", "广告管理 ") <> 0 Then Response.Write "checked " End If %> >
4.广告管理 <input name= "boxb5 " type= "checkbox " id= "boxb5 " value= "漂浮广告, " <% if instr( ", "&rs( "qx ")& ", ", "漂浮广告 ") <> 0 Then Response.Write "checked " End If %> >
5.漂浮广告 <input name= "boxb6 " type= "checkbox " id= "boxb6 " value= "LOGO管理, " <% if instr( ", "&rs( "qx ")& ", ", "LOGO管理 ") <> 0 Then Response.Write "checked " End If %> >
6.LOGO管理 </td>
</tr>
<tr>
<td class=a4> <input name= "ks1 " type= "checkbox " id= "ks1 " onClick= "convention(boxa) ">
常规管理
<input name= "ks2 " type= "checkbox " id= "ks2 " onClick= "convention(boxb) ">
广告管理
</td>
</tr>
我现在想通过写一个JS实现这样的效果:
当我点击一下常规管理前面的复选框后,将前面的常规管理类下的所有选项都选中,再点一下就都取消选中;
function convention(k){
document.form.checkallii.checked = false;
form.clear.checked = false;
for(i=1;i <16;i++){
document.form.eval(k+i).checked;
}
}
我这样写,错误提示是boxa未定义,那如何改呢?
请求指教????
[解决办法]
onClick= "convention( 'boxa ')