如何检索下一个表单上的元素 [英] how to retrieve elements on next form
问题描述
我有一个包含以下内容的表格:
第一张表格
< 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 < 5
response.write("address " & i & " = " & request.form("addr" + i) &
chr(13))
i = i + 1
wend
%>
Is the syntax correct to get the values? I tried it but I dont get any
values for the request.
If it is not the correct syntax, what should it be so I will be able to see
it when the first form posts it to the second one?
thanks,
Will
推荐答案
>而我< 5
通过此声明,您的第5个地址将永远不会被写入。改为......
而我< 6
> while i < 5
With this statement, your 5th address will never be written. Change it to...
while i < 6
response.write(" address"& i&" ="& request.form(" addr" + i)&
chr(13))
将上述行改为......
response.write(" address"& i&" =& request.form(" addr"& i)& chr(13))
(注意&替换+ )
兰迪
" wk6pack" <周*** @ sd61.bc.ca>在留言中写道
新闻:Ol ************** @ TK2MSFTNGP10.phx.gbl ...
我有一个形式包含以下内容:
第一个表格
< input type =''text''name =''addr1''value =''1223 westward''>
<输入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 ='''2楼900 Main St''>
提交表格后会将它们发布到下一个表格。
第二种形式
<%
response.write(" address"& i&" ="& request.form(" addr" + i)&
chr(13))
i = i + 1
wend
%>
获取值的语法是否正确?我尝试了但是我没有得到任何
值的请求。
如果它不是正确的语法,应该是什么,所以我将能够
在第一个表单发布时看到它它到了第二个?
谢谢,
将
response.write("address " & i & " = " & request.form("addr" + i) &
chr(13))
Change the above line to...
response.write("address " & i & " = " & request.form("addr" & i) & chr(13))
(notice the "&" replacing the "+")
Randy
"wk6pack" <wk***@sd61.bc.ca> wrote in message
news:Ol**************@TK2MSFTNGP10.phx.gbl... 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
<% response.write("address " & i & " = " & request.form("addr" + i) &
chr(13))
i = i + 1
wend
%>
Is the syntax correct to get the values? I tried it but I dont get any
values for the request.
If it is not the correct syntax, what should it be so I will be able to see it when the first form posts it to the second one?
thanks,
Will
嗨兰迪,>
那没有用。我什么都没回来。
将
Randy Rahbar < rvrahbar@_JUNKETY_JUNK_hotmail.com>在消息中写道
新闻:************** @ TK2MSFTNGP09.phx.gbl ...
Hi Randy,
That didnt work. I get nothing coming back.
Will
"Randy Rahbar" <rvrahbar@_JUNKETY_JUNK_hotmail.com> wrote in message
news:Of**************@TK2MSFTNGP09.phx.gbl...
而我< 5
通过此声明,您的第5个地址将永远不会被写入。改变它
while i < 5
With this statement, your 5th address will never be written. Change it
到...
而我< 6
to...
while i < 6
response.write(" address"& i&" ="& request.form(" addr" + i)&
chr(13))
将上面的行改为......
response.write(" address"& i&" ="& request.form(" addr" ;& i)&
response.write("address " & i & " = " & request.form("addr" + i) &
chr(13))
Change the above line to...
response.write("address " & i & " = " & request.form("addr" & i) &
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...
>我有一个包含以下元素的表格:
第一个表格
< 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''>
<输入类型=''text''name =''addr5''value ='''2楼900 Main St''>
提交表格后会将它们发布到下一个表格。 />
第二种形式
<%
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
<%
response.write(" address"& i&" =" & request.form(" addr" + i)&
chr(13))
i = i + 1
wend
%&g t;
获取值的语法是否正确?我尝试了但是我没有得到任何
值的请求。
如果它不是正确的语法,它应该是什么,所以我将能够
response.write("address " & i & " = " & request.form("addr" + i) &
chr(13))
i = i + 1
wend
%>
Is the syntax correct to get the values? I tried it but I dont get any
values for the request.
If it is not the correct syntax, what should it be so I will be able to
看到
当第一个表单发布到第二个表单时?
谢谢,
it when the first form posts it to the second one?
thanks,
Will
" wk6pack" <周*** @ sd61.bc.ca>在消息中写道
新闻:Ol ************** @ TK2MSFTNGP10.phx.gbl ...
"wk6pack" <wk***@sd61.bc.ca> wrote in message
news:Ol**************@TK2MSFTNGP10.phx.gbl...
>
我有一个包含以下内容的表格:
第一个表格
< 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 ='''2楼900 Main St''>
提交表单后会将它们发布到下一个形式。
第二种形式
<%
而我< 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 < 5
response.write("address " & i & " = " & request.form("addr" + i) &
chr(13))
i = i + 1
wend
%>
Is the syntax correct to get the values? I tried it but I dont get any
values for the request.
If it is not the correct syntax, what should it be so I will be able to see it when the first form posts it to the second one?
这应该做你想要的:
<%
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 Foti
This should do what you want:
<%
i = 1
while i < 5
frmStr = "addr" & i
Response.Write("address " & i & " = " & Request.Form(frmStr) & "<br>")
i = i + 1
wend
%>
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.Form
Response.Write(item & " = " & Request.Form(item) & "<br>")
Next
%>
Regards,
Peter Foti
这篇关于如何检索下一个表单上的元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!