I have created HUGE order forms for a client using HTML (Dreamweaver Studio MX 2004) for the forms and ASPMail for the submission of the forms. Everything works fine, except ALL the fields are submitted with every order, and I want ONLY the fields that have something in them to be submitted.
Right now my client gets a huge list of all the fields in the forms with most of them blank and a few with numbers denoting how many items a customer wants to order.
The main problem is that I'm not technically a programmer--I'm trying really hard to learn on my own, and it's difficult.
Here's the code from my "form action" page--Please be aware that to protect my client's privacy, I've replace all instances of his name and email address/domain name with "client@domain. com", etc.
<%
Set Mailer = Server.CreateOb ject("SMTPsvg.M ailer")
Mailer.FromName = "Order"
Mailer.FromAddr ess= "root@domain.co m"
Mailer.RemoteHo st = "mail.domain.co m"
Mailer.AddRecip ient "ClientName ", "client@domain. com"
Mailer.Subject = "Order"
strMsgHeader = "Form Information Follows: " & vbCrLf
for i = 1 to Request.Form.Co unt
strMsgInfo = strMsgInfo & Request.Form.Ke y(i) & " - " & Request.Form.It em(i) & vbCrLf
next
strMsgFooter = vbCrLf & "End of form information"
Mailer.BodyText = strMsgHeader & strMsgInfo & strMsgFooter
if Mailer.SendMail then
Response.Write "Thank you for using our online ordering system. You will be sent an invoice via email which you may pay online."
else
Response.Write "Mail send failure. Error was " & Mailer.Response
end if
set Mailer = Nothing
%>
Any help anyone could provide would be greatly appreciated.
Right now my client gets a huge list of all the fields in the forms with most of them blank and a few with numbers denoting how many items a customer wants to order.
The main problem is that I'm not technically a programmer--I'm trying really hard to learn on my own, and it's difficult.
Here's the code from my "form action" page--Please be aware that to protect my client's privacy, I've replace all instances of his name and email address/domain name with "client@domain. com", etc.
<%
Set Mailer = Server.CreateOb ject("SMTPsvg.M ailer")
Mailer.FromName = "Order"
Mailer.FromAddr ess= "root@domain.co m"
Mailer.RemoteHo st = "mail.domain.co m"
Mailer.AddRecip ient "ClientName ", "client@domain. com"
Mailer.Subject = "Order"
strMsgHeader = "Form Information Follows: " & vbCrLf
for i = 1 to Request.Form.Co unt
strMsgInfo = strMsgInfo & Request.Form.Ke y(i) & " - " & Request.Form.It em(i) & vbCrLf
next
strMsgFooter = vbCrLf & "End of form information"
Mailer.BodyText = strMsgHeader & strMsgInfo & strMsgFooter
if Mailer.SendMail then
Response.Write "Thank you for using our online ordering system. You will be sent an invoice via email which you may pay online."
else
Response.Write "Mail send failure. Error was " & Mailer.Response
end if
set Mailer = Nothing
%>
Any help anyone could provide would be greatly appreciated.
Comment