david_stev
11-13-2003, 11:51 AM
I have an .asp page that pulls in a number a form is then displayed with 3 text boxes if the number entered is 3 or 16 text boxes if the number entered is 16 and so on.
To do this I have used
<%For i=1 to number%>
<input type="text" name="name<%=i%>" value="">
<%next%>
This produces
<input type="text" name="name1" value = "">
<input type="text" name="name2" value = "">
and so on
This works fine and I have even been able to validate the boxes usinh JavaScript with the same technique.
What I now want to do is e-mail the results of what has been entered. This means pulling in the results setting a var to the same name as the txt box name as in:
name1 = request.form(name1)
name2 = request.form(name2)
then using a var strBody to build up the e-mail content.
So far I have
For i = 1 to number
strBody = strBody & "name" & i & "= " & name & i
next
I think you can see where I am going.
The e-mail then sends and the specified section does not appear.
I am sure I must be doing something wrong round the
& i &
section but do not know how else to do this if I try a response.write on these vars using the same technique
as in
Response.Write(name & i)
I get 1 2 written on the screen as in the value of i and not the var
if I try
Response.Write(name1)
the value of the var is displayed
any help would be greatly appreciated.
To do this I have used
<%For i=1 to number%>
<input type="text" name="name<%=i%>" value="">
<%next%>
This produces
<input type="text" name="name1" value = "">
<input type="text" name="name2" value = "">
and so on
This works fine and I have even been able to validate the boxes usinh JavaScript with the same technique.
What I now want to do is e-mail the results of what has been entered. This means pulling in the results setting a var to the same name as the txt box name as in:
name1 = request.form(name1)
name2 = request.form(name2)
then using a var strBody to build up the e-mail content.
So far I have
For i = 1 to number
strBody = strBody & "name" & i & "= " & name & i
next
I think you can see where I am going.
The e-mail then sends and the specified section does not appear.
I am sure I must be doing something wrong round the
& i &
section but do not know how else to do this if I try a response.write on these vars using the same technique
as in
Response.Write(name & i)
I get 1 2 written on the screen as in the value of i and not the var
if I try
Response.Write(name1)
the value of the var is displayed
any help would be greatly appreciated.