<%
set rs=server.createobject("adodb.recordset")
sql="select * from foreign"
rs.open sql,conn,1,1
%>
<form method="POST" name="form1" action="price_ok.asp?action=update">
<% do while not rs.eof%>
<input type="hidden" name="id" value="<%=rs("id")%>">
<input name="name" type="text" id="name" value="<%=rs("name")%>" size="17">
<input name="inpr" type="text" id="inpr" value="<%=rs("inpr")%>" size="17">
<input name="outpr" type="text" id="outpr" value="<%=rs("outpr")%>" size="17">
<% rs.movenext
loop%>
<input type="submit" name="Submit" value="提交">
<input type="reset" name="reset" value="重置"> </form>
---------------------------------price_ok.asp---------
<%
if request("action")="update" then
for i=1 to request.form("id").count
id=replace(request.form("id")(i),"'","")
name=replace(request.form("name")(i),"'","")
inpr=replace(request.form("inpr")(i),"'","")
outpr=replace(request.form("outpr")(i),"'","")
'response.write id&inpr&outpr&name
'response.write "<br>"
conn.execute("update foreign set name='"&name&"',inpr="&inpr&",outpr="&outpr&" where id="&id)
next
conn.close
set conn=nothing
response.write "<script language=javascript>alert('字段设置成功!');window.location.href='price.asp';</script>"
end if
%>