先在answer.asp中,把在四个checkbox中所取的值
1x=0
1do while not rs.eof
1<form action="grade.asp" method="post">
2<p align="left">
x=x+1
="("
1=cstr(x)
=")"
1<table bgcolor="#F4FFF4" border="0" width="100%">
2<input name="checkanswer" type="checkbox" value="a"/>//checkbox按钮A
3..
4<td ```  ;<="" choicea")="" height="26```
5=rs(" td="" width="18%">
6...
7<input name="checkanswer" type="checkbox" value="b"/>"//checkbox按钮B
8...
=rs("choiceb")
1....
2<input name="checkanswer" type="checkbox" value="c"/>//checkbox按钮c
=rs("choicec")
1...
2<input name="checkanswer" type="checkbox" value="d"/>
3...
=rs("choiced")
1</table>
rs.movenext
loop
1
2然后提交到GRADE.ASP
3
x=0
do while not rs.eof
For each dati in Request.Form("checkanswer")
1<p> ```
2x=x+1
3``` ```
4="("
=cstr(x)
1=")"
2``` ```
3
4if rs.Fields("answer")="" then
5Response.write "请确定作完后再提交测试"&"<br/>"
6end if
7if rs.Fields("answer")=dati then
8Response.write "正确"&"<br/>"
9else
10Response.write "错误"&"<br/>"
11end if
12
13rs.movenext
14Next
15loop
16
17```
18
19现在问题是当四个按钮在ANSWER.ASP中全部选择后,在GRADE中比较问题。但是如果不选就出现以下:
20\---------------------------------------------------------------
21
22在answer.asp中进行判断checkbox是否被选中(做了一些修改):
23<head>
24<script language="javascript">
25function che(thoForm){
26if (thoForm.form1.checkanswer.value=="" )
27alert("请选择值!");
28return false;
29}
30</script>
31</head>
32```
33x=0
34```
35```
36do while not rs.eof
37```
38<form action="grade.asp" method="post" name="form1" onsubmit="return che(this)">
39<p align="left">
40```
41x=x+1
42``` ```
43="("
=cstr(x)
1=")"
2```
3<table bgcolor="#F4FFF4" border="0" width="100%">
4<input name="checkanswer" type="checkbox" value="a"/>//checkbox按钮A
5..
6<td ```  ;<="" choicea")="" height="26```
7=rs(" td="" width="18%">
8...
9<input name="checkanswer" type="checkbox" value="b"/>"//checkbox按钮B
10...
11```
12=rs("choiceb")
13```
14....
15<input name="checkanswer" type="checkbox" value="c"/>//checkbox按钮c
16```
17=rs("choicec")
18``` </td>
19...
20<input name="checkanswer" type="checkbox" value="d"/>
21...
22```
23=rs("choiced")
24```
25</table>
26```
27
28rs.movenext
29loop
30
31```</p></form></p></p></form>
32```