循环显示文本框,再用form批量提交给另一文件,可是文本框里的值提交不过去.
class.asp(显示文本框并填值的文件):<body >
<form name="add" method="post" action="classsave.asp">
<table >
<%
Set rs4=Server.CreateObject("ADODB.RecordSet")
sql4="select * from 表 order by 字段1"
i=1
do while not rs4.eof
%>
<tr >
<td>
<input name="sl<%=i%>" type="text" class="input" id="sl<%=i%>" size="16">
</td>
<td>
<input name="dj<%=i%>" type="text" class="input" id="dj<%=i%>" size="16">
</td>
</tr>
<%
i=i+1
rs4.movenext
if rs4.eof then exit do
loop
end if
%>
<tr>
<td>
<input type="submit" name="Submit" value="提交">
<input type="reset" name="Submit2" value="重置">
</td>
</tr>
</table>
</form>
classsave.asp(取class.asp中的值并提交给数据库的文件):
<%
if request("act")="add" then
set rs=server.CreateObject("ADODB.RecordSet")
sql="select * from 表名"
rs.open sql,conn,3,2
i=10
do while i>=0
rs.addnew
rs("HCMC")=0
rs("RKSL")=request.form("sl"&i)
rs("JG")=request.form("dj"&i)
rs("RKRQ")=date()
rs.update
i=i-1
loop
rs.close
set rs=nothing
conn.close
set conn=nothing
response.redirect "class.asp"
%>