Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error Looping in a html format ASP CDONTS Email

Status
Not open for further replies.

egrant

Programmer
Mar 6, 2003
42
AU
Hi All,

I am using CDONTS to create an email in HTML format to send from my ASP page. I have many forms. The first offers a number to the user. When they select a number the next form field (Name) loops the number of times of the number chosen. I pass the for loop throughout my forms.

In the email I am creating I want to loop through my list of names using a for loop. NOw I know that this for loop works but not in the particular string below... I am getting a "Syntax Error" error at 'For i'.

emailbody = &quot; <table> &quot; &_
&quot; <tr> &quot; &_
&quot; <td colspan='2'><font size='2' face='Arial, Helvetica, sans-serif'>&quot; &_

For i = 1 to request.form(&quot;ChooseNumber&quot;)

&quot;Name: &quot; & request.form(&quot;FirstName&quot;&i) & request.form(&quot;LastName&quot;&i) &&quot; <br> &quot; &_


next

&quot; Company: &quot; & request.form(&quot;Organisation1&quot;)&&quot; <br>&quot; &_
&quot; </font></td>&quot; &_
&quot; </tr>&quot; &_
&quot; </table> &quot;

Any ideas would be great

EMG
 
Should be
For i = 1 to Int(request.form(&quot;ChooseNumber&quot;))

also a better Ideea would be

nr=0
if request.form(&quot;ChooseNumber&quot;)<>&quot;&quot; then nr=Int(request.form(&quot;ChooseNumber&quot;))
for i=1 to nr
...


________
George, M
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top