Emailing form input - ordering the form results..?

Results 1 to 2 of 2

Thread: Emailing form input - ordering the form results..?

  1. #1
    Caterina Guest

    Default Emailing form input - ordering the form results..?

    Hi guys,<BR><BR>I have just created a asp page that emails the results of a form to the website ownwer and also sends an email to the user letting them know that their form has been received.<BR>I managed to do this with the aid of the an excellent mailing forms article I found on the 4guysfromrolla website.<BR><BR>However the results are not displayed the order they appear in the form. ( They are returned in the same order every time but I can&#039t work out where it came from!!)<BR><BR>Here is the code I used to define the body of the emails:<BR><BR>For Each myElement in Request.Form<BR> Select Case Left(myElement,3)<BR> Case "txt","sel","rad":<BR> strBody = strBody & Replace(Mid(myElement,4,len(myElement)),"."," ") & _<BR> ": "<BR> strBody1 = strBody1 & Replace(Mid(myElement,4,len(myElement)),"."," ") & _<BR> ": "<BR> if Len(Request.Form(myElement)) = 0 then<BR> strBody = strBody & "UNANSWERED"<BR> strBody1 = strBody1 & "UNANSWERED"<BR> else<BR> strBody = strBody & Request.Form(myElement)<BR> strBody1 = strBody1 & Request.Form(myElement)<BR> end if<BR> strBody = strBody & vbCrLf<BR> strBody1 = strBody1 & vbCrLf<BR> Case "chk":<BR> strBody = strBody & Replace(Mid(myElement,4,len(myElement)),"."," ") & _<BR> ": " & Request.Form(myElement) & vbCrLf<BR> strBody1 = strBody1 & Replace(Mid(myElement,4,len(myElement)),"."," ") & _<BR> ": " & Request.Form(myElement) & vbCrLf<BR> End Select<BR> Next<BR><BR>Can anyone help me to organise the order the results in the way that they appear in the form?<BR><BR>Thanks in advance,<BR>Catherine<BR><BR>

  2. #2
    michael j elwood Guest

    Default RE: Emailing form input - ordering the form result

    ok, what i do is just hard code it out.. instead of going through some kind of loop.. i usually dont use cuz if i have others look at my code they have a hard time understanding it.. u can just use something like the following in your cdonts msg...<BR><BR>objMailer.Body = "You Have been Assigned" & vbCrLf & "Job Number: " & strJobNumber ... etc..<BR><BR>This will allow you to format the body of the email anyway you wish.. might be length to code if u have multiple fields but it gets the job done really well..<BR><BR>if you need any further help dont hesitate to email me at<BR><BR>Michael J. Elwood

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts