0

所以我试图更新我创建的表中的记录。表单处理但由于某种原因我没有看到表格列更新。HTML 表单是

<form action="divProgramProcess.asp?div=<% =divrec %>" id="countInput" class="contact_form">

<input type="text"  name="Shipment_Current" id="Shipment_Current" value="<% =Shipment_Current %>" />
<input type="text"  name="Couch_Current" id="Couch_Current"  value="<%= Couch_Current %>" />
<input type="text"  name="Person_Available_Current" id="Person_Available_Current"  value="<%= Person_Available_Current %>" />
</form>

divProgramProcess.asp 中的代码是

<%
divrec = request.QueryString("div")
Set rstest = Server.CreateObject("ADODB.Recordset")
rstest.locktype = adLockOptimistic
sql = "SELECT top 1 * FROM CensusFacility_Records_Last WHERE Count = '1239' "
rstest.Open sql, db
%>


<body> 
<%
Shipment_Current = request.form("Shipment")
Couch_Current = request.form("Couch")
Person_Available_Current = request.form("Person_Available")

rstest("Shipment") = Shipment_Current
rstest("Couch") = Couch_Current
rstest("Person_Available") = Person_Available_Current
rstest.update
Response.Redirect("chooseScreen.asp")
%>
4

1 回答 1

1

如果您有一些您知道要传递的信息,您可能会发现将其设置为隐藏输入更容易。

例如,代替您在上面执行的操作,请使用您的表单执行此操作:

<form action="divProgramProcess.asp" id="countInput" class="contact_form">

<input type="text"  name="Shipment_Current" id="Shipment_Current" value="<% =Shipment_Current %>" />
<input type="text"  name="Couch_Current" id="Couch_Current"  value="<%= Couch_Current %>" />
<input type="text"  name="Person_Available_Current" id="Person_Available_Current"  value="<%= Person_Available_Current %>" />
<input type="hidden" name="div" value="<% =divrec %>" />
</form>

div并从Request.Form集合中提取价值。

于 2013-08-22T20:33:56.170 回答