array in form post

K

Ken

I have problem getting right info using array.

When I post data with form:
<% i = 1 %>
<input type="text" name="Boys(<%=i%>)">

and retrieving the data on another page:
<%
i = 1
Response.Write Request.Form("Boys(i)")
%>

I do not see the data. If I replaced "Boys(i)" with "Boys
(1)", I can see the data. What am I missing?

Thank you for any help.
 
J

Jedediah Smith

I have problem getting right info using array.

When I post data with form:
<% i = 1 %>
<input type="text" name="Boys(<%=i%>)">

and retrieving the data on another page:
<%
i = 1
Response.Write Request.Form("Boys(i)")
%>

I do not see the data. If I replaced "Boys(i)" with "Boys
(1)", I can see the data. What am I missing?

Thank you for any help.

try Response.Write Request.Form("Boys(" & i & ")")
 
C

Chris Barber

This line is never going to work unless you have a form element named
"Boys(i)" (note the 'i', not '1')
Response.Write Request.Form("Boys(i)")

I think you meant:
Response.Write Request.Form("Boys(" & i & ")")

or slightly more readable:
Dim pstrTemp
pstrTemp = "Boys(" & i & ")"
Response.Write Request.Form(pstrTemp)

Hope this helps.

Chris.



I have problem getting right info using array.

When I post data with form:
<% i = 1 %>
<input type="text" name="Boys(<%=i%>)">

and retrieving the data on another page:
<%
i = 1
Response.Write Request.Form("Boys(i)")
%>

I do not see the data. If I replaced "Boys(i)" with "Boys
(1)", I can see the data. What am I missing?

Thank you for any help.
 
K

Ken

You are wonderful. Thanks a million. It worked.
Thanks go to Jedediah, too, who also gave me the same
solution.
Ken
 
S

Stuart Palmer

Response.Write Request.Form("Boys(i)")
boys(i) is not a field name....try:-

Response.Write Request.Form("Boys(" & i & ")")

Hope that helps.

Stu
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,139
Messages
2,570,804
Members
47,350
Latest member
TamiPutnam

Latest Threads

Top