Forums
This topic is locked
Form replys in order
18 Nov 2005 12:33:35 Malcolm X posted:
Heya all. I have created 2 seperate forms which are linked together so that the information from form one goes to form2 when submitted. Once you complete form2 all of the info on form1 and form2 is submitted.When I receive the completed forms by email, I receive all the info in a mess.
Eg.
Country
Family Name
Date of Birth
Address
Ocupation
Christian Name etc etc.
Where as the info should come through as
Christian Name
Family Name
Address
Country
Date of Birth
Ocupation
I have created these forms using DMWM04, ASP.
Can anyone suggest anything?
Thanks.
Malcolm R
Replies
Replied 18 Nov 2005 22:21:15
18 Nov 2005 22:21:15 Dave Thomas replied:
are you using CDONTS or similiar to send the form?
the order of the form elements is usually coded into the CDO or CDONTS part of the code
here is an old cdonts script i have, u can see where the body is coded to include the form parts.
<pre id=code><font face=courier size=2 id=code><font color=red>
<%@LANGUAGE="VBSCRIPT"%>
<%
Response.Buffer = True
Dim strBody
Dim objCDOMail
Dim strMyEmailAddress
Dim strCCEmailAddress
Dim strBCCEmailAddress
Dim strReturnEmailAddress
strMyEmailAddress = " "
strCCEmailAddress = ""
strBCCEmailAddress = ""
'Read in the users e-mail address
strReturnEmailAddress = Request.Form("FEmail"
'Initialse strBody string with the body of the e-mail
strBody = "<h3>E-mail sent from Web Site</h3>"
strBody = strBody & "<br><br>This is a web form Email recieved from the website contact page."
strBody = strBody & "<br><br><b>Name: </b>" & Request.Form("FName"
strBody = strBody & "<br><b>Tel:</b> " & Request.Form("FTel"
strBody = strBody & "<br><b>Email:</b> " & Request.Form("FEmail"
strBody = strBody & "<hr>"
strbody = strBody & "<b>Comments/Enquiry::</b><br>"
strBody = strBody & Replace(Request("FEnquiry", VbCrLf, "<BR>"
strBody = strBody & "<br><br>"
strBody = strBody & "<hr>"
strBody = strBody & "Email script by David Thomas (Written in ASP/VBScript & using the CDONTs mail component)"
'Check to see if the user has entered an e-mail address and that it is a valid address otherwise set the e-mail address to your own otherwise the e-mail will be rejected
If Len(strReturnEmailAddress) < 5 OR NOT Instr(1, strReturnEmailAddress, " " = 0 OR InStr(1, strReturnEmailAddress, "@", 1) < 2 OR InStrRev(strReturnEmailAddress, "." < InStr(1, strReturnEmailAddress, "@", 1) Then
'Set the return e-mail address to your own
strReturnEmailAddress = strMyEmailAddress
End If
'Send the e-mail
'Create the e-mail server object
Set objCDOMail = Server.CreateObject("CDONTS.NewMail"
'Who the e-mail is from (this needs to have an e-mail address in it for the e-mail to be sent)
objCDOMail.From = Request.Form("name" & " <" & strReturnEmailAddress & ">"
'Who the e-mail is sent to
objCDOMail.To = strMyEmailAddress
'Who the carbon copies are sent to
objCDOMail.Cc = strCCEmailAddress
'Who the blind copies are sent to
objCDOMail.Bcc = strBCCEmailAddress
'Set the subject of the e-mail
objCDOMail.Subject = "Some Info wanted"
'Set the e-mail body format (0=HTML 1=Text)
objCDOMail.BodyFormat = 0
'Set the mail format (0=MIME 1=Text)
objCDOMail.MailFormat = 0
'Set the main body of the e-mail
objCDOMail.Body = strBody
'Importance of the e-mail (0=Low, 1=Normal, 2=High)
objCDOMail.Importance = 1
'Send the e-mail
objCDOMail.Send
'Close the server object
Set objCDOMail = Nothing
%>
</font id=red></font id=code></pre id=code>
regards
Dave Thomas
<b>DMX Zone Manager</b>
the order of the form elements is usually coded into the CDO or CDONTS part of the code
here is an old cdonts script i have, u can see where the body is coded to include the form parts.
<pre id=code><font face=courier size=2 id=code><font color=red>
<%@LANGUAGE="VBSCRIPT"%>
<%
Response.Buffer = True
Dim strBody
Dim objCDOMail
Dim strMyEmailAddress
Dim strCCEmailAddress
Dim strBCCEmailAddress
Dim strReturnEmailAddress
strMyEmailAddress = " "
strCCEmailAddress = ""
strBCCEmailAddress = ""
'Read in the users e-mail address
strReturnEmailAddress = Request.Form("FEmail"
'Initialse strBody string with the body of the e-mail
strBody = "<h3>E-mail sent from Web Site</h3>"
strBody = strBody & "<br><br>This is a web form Email recieved from the website contact page."
strBody = strBody & "<br><br><b>Name: </b>" & Request.Form("FName"
strBody = strBody & "<br><b>Tel:</b> " & Request.Form("FTel"
strBody = strBody & "<br><b>Email:</b> " & Request.Form("FEmail"
strBody = strBody & "<hr>"
strbody = strBody & "<b>Comments/Enquiry::</b><br>"
strBody = strBody & Replace(Request("FEnquiry", VbCrLf, "<BR>"
strBody = strBody & "<br><br>"
strBody = strBody & "<hr>"
strBody = strBody & "Email script by David Thomas (Written in ASP/VBScript & using the CDONTs mail component)"
'Check to see if the user has entered an e-mail address and that it is a valid address otherwise set the e-mail address to your own otherwise the e-mail will be rejected
If Len(strReturnEmailAddress) < 5 OR NOT Instr(1, strReturnEmailAddress, " " = 0 OR InStr(1, strReturnEmailAddress, "@", 1) < 2 OR InStrRev(strReturnEmailAddress, "." < InStr(1, strReturnEmailAddress, "@", 1) Then
'Set the return e-mail address to your own
strReturnEmailAddress = strMyEmailAddress
End If
'Send the e-mail
'Create the e-mail server object
Set objCDOMail = Server.CreateObject("CDONTS.NewMail"
'Who the e-mail is from (this needs to have an e-mail address in it for the e-mail to be sent)
objCDOMail.From = Request.Form("name" & " <" & strReturnEmailAddress & ">"
'Who the e-mail is sent to
objCDOMail.To = strMyEmailAddress
'Who the carbon copies are sent to
objCDOMail.Cc = strCCEmailAddress
'Who the blind copies are sent to
objCDOMail.Bcc = strBCCEmailAddress
'Set the subject of the e-mail
objCDOMail.Subject = "Some Info wanted"
'Set the e-mail body format (0=HTML 1=Text)
objCDOMail.BodyFormat = 0
'Set the mail format (0=MIME 1=Text)
objCDOMail.MailFormat = 0
'Set the main body of the e-mail
objCDOMail.Body = strBody
'Importance of the e-mail (0=Low, 1=Normal, 2=High)
objCDOMail.Importance = 1
'Send the e-mail
objCDOMail.Send
'Close the server object
Set objCDOMail = Nothing
%>
</font id=red></font id=code></pre id=code>
regards
Dave Thomas
<b>DMX Zone Manager</b>