joe_main
02-26-2006, 07:43 AM
Hi,
I'm a beginner at VBScript but have been able to retrieve data entered in a form in an email. I have one problems with the form -
Problem - I have 2 rows and 9 columns in part of my form. When I don't type anything in the columns let's say in the second row and I submit the form, I don't want to see the second row since no data was entered. The same with the first row, if no data was entered, I don't want to display the empty row or rows in the email. I've been working on this for days, and I can't figure out how to not display the empty row(s). I hope somebody can help.
Here's the code:
'Row 1
If (Request.Form) > "" Then
strBody = strBody & "<tr><td height=40 align=center class=border><span class=txt>" & Request.Form("column1") & " " &"</span></td>"
strBody = strBody & "<td align=center class=border><span class=txt>" & Request.Form("column2") & " " &"</span></td>"
strBody = strBody & "<td align=center class=border><span class=txt>" & Request.Form("column3") & " " &"</span></td>"
strBody = strBody & "<td align=center class=border><span class=txt>" & Request.Form("column4") & " " &"</span></td>"
strBody = strBody & "<td align=center class=border><span class=txt>" & Request.Form("column5") & " " &"</span></td>"
strBody = strBody & "<td align=center class=border><span class=txt>" & Request.Form("column6") & " " &"</span></td>"
strBody = strBody & "<td align=center class=border><span class=txt>" & Request.Form("column7") & " " &"</span></td>"
strBody = strBody & "<td align=center class=border><span class=txt>" & Request.Form("column8") & " " &"</span></td>"
strBody = strBody & "<td align=center class=border><span class=txt>" & Request.Form("column9") & " " &"</span></td></tr>"
End If
'Row 2
If (Request.Form) > "" Then
strBody = strBody & "<tr><td height=40 align=center class=border><span class=txt>" & Request.Form("column1_r2") & " " &"</span></td>"
strBody = strBody & "<td align=center class=border><span class=txt>" & Request.Form("column2_r2") & " " &"</span></td>"
strBody = strBody & "<td align=center class=border><span class=txt>" & Request.Form("column3_r2") & " " &"</span></td>"
strBody = strBody & "<td align=center class=border><span class=txt>" & Request.Form("column4_r2") & " " &"</span></td>"
strBody = strBody & "<td align=center class=border><span class=txt>" & Request.Form("column5_r2") & " " &"</span></td>"
strBody = strBody & "<td align=center class=border><span class=txt>" & Request.Form("column6_r2") & " " &"</span></td>"
strBody = strBody & "<td align=center class=border><span class=txt>" & Request.Form("column7_r2") & " " &"</span></td>"
strBody = strBody & "<td align=center class=border><span class=txt>" & Request.Form("column8_r2") & " " &"</span></td>"
strBody = strBody & "<td align=center class=border><span class=txt>" & Request.Form("column9_r2") & " " &"</span></td></tr>"
End If
****
I'm a beginner at VBScript but have been able to retrieve data entered in a form in an email. I have one problems with the form -
Problem - I have 2 rows and 9 columns in part of my form. When I don't type anything in the columns let's say in the second row and I submit the form, I don't want to see the second row since no data was entered. The same with the first row, if no data was entered, I don't want to display the empty row or rows in the email. I've been working on this for days, and I can't figure out how to not display the empty row(s). I hope somebody can help.
Here's the code:
'Row 1
If (Request.Form) > "" Then
strBody = strBody & "<tr><td height=40 align=center class=border><span class=txt>" & Request.Form("column1") & " " &"</span></td>"
strBody = strBody & "<td align=center class=border><span class=txt>" & Request.Form("column2") & " " &"</span></td>"
strBody = strBody & "<td align=center class=border><span class=txt>" & Request.Form("column3") & " " &"</span></td>"
strBody = strBody & "<td align=center class=border><span class=txt>" & Request.Form("column4") & " " &"</span></td>"
strBody = strBody & "<td align=center class=border><span class=txt>" & Request.Form("column5") & " " &"</span></td>"
strBody = strBody & "<td align=center class=border><span class=txt>" & Request.Form("column6") & " " &"</span></td>"
strBody = strBody & "<td align=center class=border><span class=txt>" & Request.Form("column7") & " " &"</span></td>"
strBody = strBody & "<td align=center class=border><span class=txt>" & Request.Form("column8") & " " &"</span></td>"
strBody = strBody & "<td align=center class=border><span class=txt>" & Request.Form("column9") & " " &"</span></td></tr>"
End If
'Row 2
If (Request.Form) > "" Then
strBody = strBody & "<tr><td height=40 align=center class=border><span class=txt>" & Request.Form("column1_r2") & " " &"</span></td>"
strBody = strBody & "<td align=center class=border><span class=txt>" & Request.Form("column2_r2") & " " &"</span></td>"
strBody = strBody & "<td align=center class=border><span class=txt>" & Request.Form("column3_r2") & " " &"</span></td>"
strBody = strBody & "<td align=center class=border><span class=txt>" & Request.Form("column4_r2") & " " &"</span></td>"
strBody = strBody & "<td align=center class=border><span class=txt>" & Request.Form("column5_r2") & " " &"</span></td>"
strBody = strBody & "<td align=center class=border><span class=txt>" & Request.Form("column6_r2") & " " &"</span></td>"
strBody = strBody & "<td align=center class=border><span class=txt>" & Request.Form("column7_r2") & " " &"</span></td>"
strBody = strBody & "<td align=center class=border><span class=txt>" & Request.Form("column8_r2") & " " &"</span></td>"
strBody = strBody & "<td align=center class=border><span class=txt>" & Request.Form("column9_r2") & " " &"</span></td></tr>"
End If
****