本文介绍了如何检索下一个表单上的元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我有一个包含以下内容的表格: 第一张表格 < input type =' 'text''name =''addr1''value =''1223 westward''> < input type =''text''name =''addr2''value ='' 12位海军上将rd''> < input type =''text''name =''addr3''value ='''90 Northward''> < input type =''text''name =''addr4''value =''apt 12 34 Marine way''> < input type =''text''name = ''addr5''value ='''2楼900 Main St''> 提交表格后会将它们发布到下一个表格。 第二张表格 <% 而i< 5 response.write(" address"& i&" ="& request.form(" addr" + i)& chr(13)) i = i + 1 wend %> 语法是否正确以获取值?我尝试了但是我没有得到任何 值的请求。 如果它不是正确的语法,它应该是什么,所以我将能够看到 当第一个表格发布到第二个表格时? 谢谢, 将Hi,I have a form with the following elements:first form<input type=''text'' name=''addr1'' value=''1223 westward''><input type=''text'' name=''addr2'' value=''12 admirals rd''><input type=''text'' name=''addr3'' value=''90 Northward''><input type=''text'' name=''addr4'' value=''apt 12 34 Marine way''><input type=''text'' name=''addr5'' value=''2nd floor 900 Main St''>on submit the form will post them to the next form.second form<%while i < 5response.write("address " & i & " = " & request.form("addr" + i) &chr(13))i = i + 1wend%>Is the syntax correct to get the values? I tried it but I dont get anyvalues for the request.If it is not the correct syntax, what should it be so I will be able to seeit when the first form posts it to the second one?thanks,Will推荐答案 到... 而我< 6to... while i < 6 chr(13))(注意&替换+) " wk6pack" <周*** @ sd61.bc.ca>在消息中写道新闻:Ol ************** @ TK2MSFTNGP10.phx.gbl ...chr(13)) (notice the "&" replacing the "+") Randy "wk6pack" <wk***@sd61.bc.ca> wrote in message news:Ol**************@TK2MSFTNGP10.phx.gbl... 看到 这应该做你想要的: <% i = 1 而i< 5 frmStr =" addr" &安培; i Response.Write(" address"& i&" ="& Request.Form(frmStr)&"< br>") i = i + 1 wend %> 请注意,另一个选项可能是通过Form集合进行交互, 但它还包括提交按钮和任何其他表单输入 <%: For Request.Form中的每个项目 Response.Write(item&" ="& Request.Form(item)&"< br>") Next %> 问候, Peter FotiThis should do what you want:<%i = 1while i < 5frmStr = "addr" & iResponse.Write("address " & i & " = " & Request.Form(frmStr) & "<br>")i = i + 1wend%>Note that another option might be to interate through the Form collection,but it will also include the submit button, and any other form inputs<%:For Each item in Request.FormResponse.Write(item & " = " & Request.Form(item) & "<br>")Next%>Regards,Peter Foti 这篇关于如何检索下一个表单上的元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-19 09:33
查看更多