|
-
Mar 18th, 2002, 09:48 AM
#1
Thread Starter
Fanatic Member
receiving variables
<%
i = 1
product1 = Request.Form("product" & i)
%>
i wanna receive the variable name "product1" by putting "product" and i together.
The above code tho doesn't work. Any ideas?
Thanks
Nick
-
Mar 18th, 2002, 09:53 AM
#2
Fanatic Member
Hi nick
Have you got the Input's inclosed within a form tag, as you need it to be able pass it through and that you submit it ? ie.
<form name="Form1" Method="GET" Action="Myasppage.asp">
<Input type="Text" name="Product1">
<Input type="Submit" value="Post Values">
</form>
Ian
Yeah, well I'm gonna build my own lunar space lander! With blackjack aaaaannd Hookers! Actually, forget the space lander, and the blackjack. Ahhhh forget the whole thing!
-
Mar 18th, 2002, 10:33 AM
#3
Thread Starter
Fanatic Member
i can receive the variable "product1"
but what i wanna do is put a count in
<%
i = 1 to 10
product & i = Request.Form("product" & i)
next
%>
so that it recieves products 1 to 10 and puts them in variables 1 to 10.
Is this possible?
Nick
-
Mar 18th, 2002, 10:49 AM
#4
Fanatic Member
Originally posted by nswan
i can receive the variable "product1"
product & i = Request.Form("product" & i)
the above is your problem, as you cannot ass concatenate to make a variable. What I would suggest you do, is store the variables into an array ie.
<%
Dim Products
ReDim Products(9)
i = 1 to 10
products(iflag -1) = Request.Form("product" & i)
next
%>
Yeah, well I'm gonna build my own lunar space lander! With blackjack aaaaannd Hookers! Actually, forget the space lander, and the blackjack. Ahhhh forget the whole thing!
-
Mar 18th, 2002, 10:57 AM
#5
Thread Starter
Fanatic Member
that would be cool.....
but the
Request.Form("product" & i)
doesn't seem to work. It just request "product"
-
Mar 18th, 2002, 11:06 AM
#6
Thread Starter
Fanatic Member
i tell a lie.....it works okay!!
Thanks mate
-
Mar 18th, 2002, 11:43 AM
#7
Fanatic Member
np, was just about to reply with there shouldn't be anything wrong with that code
Yeah, well I'm gonna build my own lunar space lander! With blackjack aaaaannd Hookers! Actually, forget the space lander, and the blackjack. Ahhhh forget the whole thing!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|