查看: 415|回复: 3

[ASP入门] 求助:如何把结果放入指定表单中?

[复制链接]
烘干机 发表于 2023-2-18 23:46:09 | 显示全部楼层 |阅读模式
代码如下:

<form id="form1" name="form1" method="post" action="">
数字一
<input type="text" name="no1" id="no1" />
数字二
<input type="text" name="no2" id="no2" />
结果
<input type="text" name="no3" id="no3" />
<%
If Request.Form("no1")<>"" And Request.Form("no2")<>"" Then
Response.Write "<label>"&Cint(Request.Form("no1"))*Cint(Request.Form("no2"))&"</label>"
<!--注:直接切换+-*/,即可-->
End If
%>
<br>
<br>
<input type="submit" name="button" id="button" value="计算" />
</form>

如何把结果放入no3表单中?
xuanxiao 发表于 2023-2-19 21:47:58 | 显示全部楼层
  1. <%
  2. Dim iVal
  3. Dim NO1,NO2
  4. NO1=Request.Form("no1")
  5. NO2=Request.Form("no2")

  6. If NO1<>"" AND NO2<>"" then
  7. iVal=NO1+NO2
  8. End if
  9. %>

  10. <form id="form1" name="form1" method="post" action="?">
  11. 数字一
  12. <input type="text" name="no1" id="no1" />
  13. 数字二
  14. <input type="text" name="no2" id="no2" />
  15. 结果
  16. <input type="text" name="no3" id="no3" value="<%= iVal %>" />
  17. <%
  18. If Request.Form("no1")<>"" And Request.Form("no2")<>"" Then
  19. Response.Write "<label>"&Cint(Request.Form("no1"))*Cint(Request.Form("no2"))&"</label>"
  20. <!--注:直接切换+-*/,即可-->
  21. End If
  22. %>
  23. <br>
  24. <br>
  25. <input type="submit" name="button" id="button" value="计算" />
  26. </form>
复制代码


试试看
 楼主| 烘干机 发表于 2023-2-19 22:21:12 | 显示全部楼层

非常感谢!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表

在线客服

售前咨询
售后咨询
服务热线
023-58418553
微信公众号