回复:(青青)我想把单选提交投票改为多项选择提交,...
主程序:
<form method="POST" action="add.asp" name="research" LANGUAGE="javascript"
onsubmit="return research_onsubmit()">
<p align="center" style="line-height: 200%; margin-top: 1; margin-bottom: 1"> <font size="3" color="#000080"><b>投
票 区</b></font></p>
<p align="left" style="line-height: 200%; margin-top: 1; margin-bottom: 1">
<input type="checkbox" value="a" name="Options" checked><font color="#000080">
</font><font color="#000080">北京</font></p>
<p align="left" style="line-height: 200%; margin-top: 1; margin-bottom: 1"><input type="checkbox" value="b" name="Options"><font color="#000080">
</font><font color="#000080">上海</font></p>
<p align="left" style="line-height: 200%; margin-top: 1; margin-bottom: 1">
<input type="checkbox" value="c" name="Options"><font color="#000080">
广州</font></p>
<p align="left" style="line-height: 200%; margin-top: 1; margin-bottom: 1">
<input type="checkbox" value="d" name="Options"><font color="#000080">
青岛</font></p>
<p align="left" style="line-height: 200%; margin-top: 1; margin-bottom: 1">
<input type="checkbox" value="e" name="Options">
<font color="#000080">深圳</font></p>
<p align="left" style="line-height: 200%; margin-top: 1; margin-bottom: 1">
<input type="checkbox" value="f" name="Options">
<font color="#000080">大连</font></p>
<p align="center" style="line-height: 200%; margin-top: 1; margin-bottom: 1"> </p>
<p align="center" style="line-height: 200%; margin-top: 1; margin-bottom: 1"><input type="submit" value=" 投 票 " name="cmdok" class="p9" style="background-color: rgb(145,148,195); color: rgb(255,255,255)" ></p>
</form>
添加程序:
<!--#include file="conn.asp"-->
<%
dim rs
dim sql
dim selected
selected=request.form("options")
set rs=server.createobject("adodb.recordset")
sql="update research set select"&selected&"=select"&selected&"+1 where id=1"
rs.open sql,conn,1,3
set rs=nothing
conn.close
set conn=nothing
response.redirect "index.asp"
else
Response.write "您已经投了票,谢谢您的支持!"
end if
%>