Order of data from Form Fields

Discussion in 'ASP General' started by Peter, Feb 14, 2005.

  1. Peter

    Peter Guest

    Dear All, I have an odd problem. I am using the asp code below to loop
    through a form and get the data sent out in an email... however the
    data from the form arrives out of order. Can any one suggest how to put
    the data in the same order as the form?

    <%
    Dim objMail
    Set objMail = CreateObject("CDONTS.Newmail")
    objMail.TO = ""
    objMail.From = Request.Form("Email")
    objmail.Subject = "Booking Request from XYZ Web Site"
    objMail.MailFormat = cdoMailFormatMime
    objMail.BodyFormat = cdoBodyFormatHTML

    sMailBody = sMailBody &"<html><body>"
    For each item in Request.Form
    if item <> "submit" then
    if item <> "clear" then
    sMailBody=sMailBody & item & ": " & Request.Form(item) & "<br>"
    end if
    end if
    next
    sMailBody = sMailBody &"</body></html>"

    objMail.Body = sMailBody
    objMail.send
    set objMail = Nothing
    %>
     
    Peter, Feb 14, 2005
    #1
    1. Advertisements

  2. Peter

    Bob Lehmann Guest

    Bob Lehmann, Feb 14, 2005
    #2
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.