<form id="form" name="form" action="xuantido.asp" method="post">
<table border="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
<tr>
<td width="100%" height="25">单项选题数:<input type="text" name="lefttime" size="20" class="inputborder" readonly></td>
</tr>
<tr>
<td width="100%" height="25"><b><font size="3" color="#000080">一、单项选择题</font></b></td>
</tr>
</table>
<%
sql="select * from tiku where xuan=0 and xiangmuid=1 and leixingid=1"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,3,2
singlecount=rs.recordcount
for i=1 to singlecount
%>
<table border="0" cellspacing="1" style="border-collapse: collapse" bordercolor="#C0C0C0" width="100%" id="AutoNumber2" cellpadding="0">
<tr>
<td width="100%" bgcolor="#EFEFEF" height="20"> <input type="checkbox" name="NO<%=rs("id")%>" value="1" onclick="javascript:submitit();"><b><%=i%>、<%=rs("tigan")%></b></td>
</tr>
<%
if rs("text1")<>"" then
%>
<tr>
<td width="100%"> A、<%=rs("text1")%></td>
</tr>
<%
end if
%> <%
if rs("text2")<>"" then
%>
<tr>
<td width="100%"> B、<%=rs("text2")%></td>
</tr>
<%
end if
%> <%
if rs("text3")<>"" then
%>
<tr>
<td width="100%"> C、<%=rs("text3")%></td>
</tr>
<%
end if
%> <%
if rs("text4")<>"" then
%>
<tr>
<td width="100%"> D、<%=rs("text4")%></td>
</tr>
<%
end if
%> <%
if rs("text5")<>"" then
%>
<tr>
<td width="100%"> E、<%=rs("text5")%></td>
</tr>
<%
end if
%> <%
if rs("text6")<>"" then
%>
<tr>
<td width="100%"> F、<%=rs("text6")%></td>
</tr>
<%
end if
%>
</table>
<%
rs.movenext
next
rs.close
set rs=nothing
%>
<script language="javascript">
var jishu=0;
function submitit()
{
if (document.all.[color=#0000FF]this.checked==false)
{
jishu--;
}
else
{
jishu++;
}
document.all.lefttime.value=jishu;
}
</script>[/color]
以上代码主要是想实现选中每道选择题前的复选框有一个计数,好知道当前已经选取了多少题,当提交前去掉这道题时计数接着减少,但是document.all.this.checked==false 中的这个this变量如何确定始终无法解决。请各位指点。
<table border="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
<tr>
<td width="100%" height="25">单项选题数:<input type="text" name="lefttime" size="20" class="inputborder" readonly></td>
</tr>
<tr>
<td width="100%" height="25"><b><font size="3" color="#000080">一、单项选择题</font></b></td>
</tr>
</table>
<%
sql="select * from tiku where xuan=0 and xiangmuid=1 and leixingid=1"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,3,2
singlecount=rs.recordcount
for i=1 to singlecount
%>
<table border="0" cellspacing="1" style="border-collapse: collapse" bordercolor="#C0C0C0" width="100%" id="AutoNumber2" cellpadding="0">
<tr>
<td width="100%" bgcolor="#EFEFEF" height="20"> <input type="checkbox" name="NO<%=rs("id")%>" value="1" onclick="javascript:submitit();"><b><%=i%>、<%=rs("tigan")%></b></td>
</tr>
<%
if rs("text1")<>"" then
%>
<tr>
<td width="100%"> A、<%=rs("text1")%></td>
</tr>
<%
end if
%> <%
if rs("text2")<>"" then
%>
<tr>
<td width="100%"> B、<%=rs("text2")%></td>
</tr>
<%
end if
%> <%
if rs("text3")<>"" then
%>
<tr>
<td width="100%"> C、<%=rs("text3")%></td>
</tr>
<%
end if
%> <%
if rs("text4")<>"" then
%>
<tr>
<td width="100%"> D、<%=rs("text4")%></td>
</tr>
<%
end if
%> <%
if rs("text5")<>"" then
%>
<tr>
<td width="100%"> E、<%=rs("text5")%></td>
</tr>
<%
end if
%> <%
if rs("text6")<>"" then
%>
<tr>
<td width="100%"> F、<%=rs("text6")%></td>
</tr>
<%
end if
%>
</table>
<%
rs.movenext
next
rs.close
set rs=nothing
%>
<script language="javascript">
var jishu=0;
function submitit()
{
if (document.all.[color=#0000FF]this.checked==false)
{
jishu--;
}
else
{
jishu++;
}
document.all.lefttime.value=jishu;
}
</script>[/color]
以上代码主要是想实现选中每道选择题前的复选框有一个计数,好知道当前已经选取了多少题,当提交前去掉这道题时计数接着减少,但是document.all.this.checked==false 中的这个this变量如何确定始终无法解决。请各位指点。
解决方案 »
- 左侧的焦点图效果
- 如何突破同源策略?
- 关于escape转换参数的小问题
- 请问:怎么样将FIREBUG解析的javascript 复制出来??非常急!!!
- javascript对象如何转为成c#实体类?
- window.showModalDialog有permission denied错误,急求!!!
- 求一简单js代码(30分钟后结贴)
- AJAX php JAVA学习群28878407
- 大家帮忙看看这个菜单是怎么实现的
- 我把移动端网页强制成横屏的时候,echarts图表的交互出现问题,tooltip提示框貌似出现了错位。这个怎么解决?
- js 表单问题,高手帮忙看看
- 很多人在prompt()的函数外面,都包上一层 eval()函数,有什么作用呢?
{
if (elem.checked==false)
{
jishu--;
}
else
{
jishu++;
}
document.all.lefttime.value=jishu;
}