js判断radio,checkbox 问题
<form action= "elearning_paperHandle.jsp " method= "post " name= "paperForm ">
<%
String paperid = request.getParameter( "paperid ");//卷id
java.util.Hashtable ht4 =(java.util.Hashtable) learning.impl.LearnInstance.getTestInstance().loadPaper(paperid);
%>
<input name= "paperid1 " type= "hidden " value= " <%=paperid%> ">
<input name= "opt " type= "hidden " value= "online ">
<input name= "courseid " type= "hidden " value= " <%=request.getParameter( "courseid ")%> ">
<tr>
<td height= "25 " colspan= "4 " style= "border-bottom:1px #39D0FA solid; ">
<div align= "center "> <strong> <%=ht4.get( "NAME ")%> </strong> <strong> </strong> </div> </td>
</tr>
<tr>
<td colspan= "4 " style= "line-height:20px;padding-top:8px;padding-bottom:8px; " >
<table width= "100% "> <tr> <td> <div align= "right "> </div> </td> </tr> </table>
<table width= "100% " border= "0 " cellspacing= "0 " cellpadding= "0 ">
<tr>
<td style= "line-height:20px;border-bottom:1px #ececec dashed; padding-top:8px;padding-bottom:8px; " > <strong> 一、单选题
</strong> <br>
<%
java.util.Vector quizList = learning.impl.LearnInstance.getTestInstance().getQuizs(paperid, "0 ");
for(int k=0;k <quizList.size();k++){
int p=k+1;
java.util.Hashtable ht = (java.util.Hashtable)quizList.get(k);
String quizid = (String)ht.get( "QUIZID ");
java.util.Hashtable ht1 = learning.impl.LearnInstance.getTestInstance().loadQuiz(quizid);
%>
<table width= "100% " border= "0 " cellspacing= "0 " cellpadding= "0 ">
<tr>
<td width= "88% " height= "25 "> <strong> <%=p%> . <%=ht1.get( "TITLE ")%> () </strong> </td>
<td width= "12% " height= "25 ">
</td>
</tr>
<tr>
<td colspan= "2 ">
<%
java.util.Vector list = learning.impl.LearnInstance.getTestInstance().getQuizoptions(quizid);
for(int i=0;i <list.size();i++){
int j =i+1;
java.util.Hashtable ht2 = (java.util.Hashtable)list.get(i);
%>
<input type= "radio " name= "radiobutton <%=quizid%> " value= " <%=j%> ">
选项 <%=j%> : <%=ht2.get( "OPTIONS ")%> <br>
<%}%>
<!-- 请选择正确答案:() --> </td>
</tr>
</table>
<%}%>
</td> </tr>
</table>
<table width= "100% " border= "0 " cellspacing= "0 " cellpadding= "0 ">
<tr>
<td style= "line-height:20px;border-bottom:1px #ececec dashed; padding-top:8px;padding-bottom:8px; " > <strong> 二、多选题 </strong> <br>
<%
quizList = learning.impl.LearnInstance.getTestInstance().getQuizs(paperid, "1 ");
for(int k=0;k <quizList.size();k++){
int p=k+1;
java.util.Hashtable ht= (java.util.Hashtable)quizList.get(k);
String quizid = (String)ht.get( "QUIZID ");
java.util.Hashtable ht1 = learning.impl.LearnInstance.getTestInstance().loadQuiz(quizid);
%>
<table width= "100% " border= "0 " cellspacing= "0 " cellpadding= "0 ">
<tr>
<td width= "90% " height= "25 "> <strong> <%=p%> . <%=ht1.get( "TITLE ")%> () </strong> </td>
<td width= "10% " height= "25 "> </td>
</tr>
<tr>
<td colspan= "2 ">
<%
java.util.Vector list = learning.impl.LearnInstance.getTestInstance().getQuizoptions(quizid);
for(int i=0;i <list.size();i++){
int j =i+1;
java.util.Hashtable ht2 = (java.util.Hashtable)list.get(i);
%>
<input type= "checkbox " name= "checkbox <%=quizid%> " value= " <%=j%> ">
选项 <%=j%> : <%=ht2.get( "OPTIONS ")%>
<br>
<%}%>
</td>
</tr>
</table>
<%}%>
</td>
</tr>
</table>
</strong> </td>
</tr>
<tr> <td>
<table width= "100% ">
<tr> <td align= "center ">
<%
String status=(String)ht4.get( "STATUS ");
if( "0 ".equals(status)){
%>
<input name= "name " type= "button " value= "确定 " onClick= "answerPaper() ">
<%}%>
<input name= "name1 " type= "button " value= "取消 " onClick= "location.href( 'elearning_studentonlineTest.jsp ') "> </td>
</tr>
</table>
</td> </tr>
</form>
代码如上,这是个卷子的显示页面,就是显示题目和题干内容.上面的是单项选择,下面的是多项选择,现在我想用js判断是否选中答案,怎么判断?
[解决办法]
看看有没有用
http://blog.csdn.net/rainv/archive/2007/01/14/1482624.aspx