|
前台:
<script type="text/javascript">
function showadv() {
if (document.getElementById("sk").checked == true) {
document.getElementById("adv").style.display = "";
}
else {
document.getElementById("adv").style.display = "none";
}
}
</script>
<body>
<div align="center">
<form action="addsave.asp" name="add" method="post">
<p>是否收款:
<input type="radio" name="sk" value="是" />
<span class="STYLE2">是</span>
<input type="radio" name="sk" value="否" />
<span class="STYLE2">否</span></p>
<table summary="收款 高级选项" cellspacing="0" cellpadding="0" id="adv" style="display: none;">
<tr>
<td>
收款日期:
<input name="skrq" type="text" size="15" />
已收款金额:
<input name="skje" type="text" size="15" />
</td>
</tr>
</table>
</p>
我是打算,假如选择“是”那么则弹出“收款日期”和“收款金额”选项,选择否则不弹出选项。
后台:
<%@LANGUAGE="VBScript" codepage="936"%>
<!--#include file="conn.asp"-->
<%
set rs=server.createobject("adodb.recordset")
sql="sk,skrq,skje from main”
rs.open sql,conn,1,3
rs.addnew
sk=request.form("sk")
rs("sk")=sk
rs("skrq")=skrq
rs("skje")=skje
rs.update
rs.close
set rs=nothing
conn.close
set rs=nothing
%>
想把单选按钮 “是”或者“否”写入数据库,但试了很多次还是出错。。求教了!! |
|