#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2002
    Location
    Canberra, Australia
    Posts
    348
    Rep Power
    13

    Losing hair fast, retrieve form value not working


    Im having a really hard time understanding why my mailer is not getting the form values

    Code:
    <form name="cp_apply" method="post" action="formmail.asp" enctype="multipart/form-data">
    <input type="hidden" name="subject" value="Job Submission, Position <%=strJobRef%>">
    <table border="0" cellspacing="0" cellpadding="5">
    <caption>Campbell Page - Position Details</caption>
      <tr valign="top">
        <td><strong>Job Reference:</strong></td>
        <td><textarea name="jobReference" id="jobReference" readonly><%=strJobRef%></textarea></td>
      </tr>
      <tr valign="top">
        <td><strong>Campbell Page Grade:</strong></td>
        <td><textarea name="cpGrade" id="Grade" class="text" readonly><%=strCpClass%></textarea></td>
      </tr>
      <tr valign="top">
        <td><strong>Location:</strong></td>
        <td><textarea name="Location" id="Location" class="text" readonly><%=strLocation%></textarea></td>
      </tr>
    </table>
    </form>
    In formmail.asp I have the following:
    Code:
    'Set vars and Build Email
    	strFromEmail = Request.Form("email")
    	strSubject = Request.Form("subject")
    	
    	strjobReference = Request.Form("jobReference")
    	strcpGrade = Request.Form("strcpGrade")
    	strcpLocation = Request.Form("strcpLocation")
    	
    	strMessage = "<HTML><HEAD>"
    	strMessage = strMessage & "<STYLE> BODY,TABLE, TD, P {FONT-FAMILY:  Verdana; FONT-SIZE: 10pt;}</STYLE>"
    	strMessage = strMessage & "</HEAD><BODY>"
    	strMessage = strMessage & "<h2>AEC Media Enquiry Record</h2>"
    
    	strMessage = strMessage & "<p><b>Caller Details</b></p>"
    	strMessage = strMessage & "<table width='600' cellpadding='0' cellspacing='5'>"
    	strMessage = strMessage & "<tr><td width='200'>Job Reference Number:</td><td width='350'>" & strjobReference & "</td></tr>"
    	strMessage = strMessage & "<tr><td width='200'>Grade:</td><td width='350'>" & strcpGrade & "</td></tr>"
    	strMessage = strMessage & "<tr><td width='200'>Vacancy Location:</td><td width='350'>" & strcpLocation & "</td></tr>"
    	
    	strMessage = strMessage & "</HTML></BODY>"
    		
    ' Mail Procedure 
    Set objMail=CreateObject("CDO.Message")
    objMail.Subject = strSubject
    'objMail.From = strFromEmail
    objMail.From = "phil@domain.com"
    objMail.To = cTo
    objMail.Cc = cCC
    objMail.HTMLBody = strMessage
    objMail.Send
    set objMail=nothing
    My mail server is creating the email but without any of the set values. Any clues/advice would be much appreciated.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2005
    Posts
    222
    Rep Power
    15
    have you tried doind response.Write statements to make sure it's coming through?
    Code:
    strFromEmail = Request.Form("email")
    	strSubject = Request.Form("subject")
    	
    	strjobReference = Request.Form("jobReference")
    	strcpGrade = Request.Form("strcpGrade")
    	strcpLocation = Request.Form("strcpLocation")
            response.Write("Email: " & strFromEmail & "<br />")
            response.Write("Subject: " & strSubject & "<br />")
            etc ....
            response.End
  4. #3
  5. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    May 2006
    Location
    Kent, England
    Posts
    857
    Rep Power
    575
    You should replace

    Code:
    	strcpGrade = Request.Form("strcpGrade")
    	strcpLocation = Request.Form("strcpLocation")
    with
    Code:
    	strcpGrade = Request.Form("cpGrade")
    	strcpLocation = Request.Form("cpLocation")
    It turns out there are stupid questions. And I don't know the answers!
    Over 50? Visit the Saga Zone - Social Networking for the Over 50's





    For every action there is an equal and opposite - government program
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2002
    Location
    Canberra, Australia
    Posts
    348
    Rep Power
    13
    thanks guys the form values aren't being passed... Not sure why..

    The fields

    jobReference
    cpGrade
    Location

    are set by being passed from another form, though that shouldn't stop the information or the form not to be sent, should it,,,

    I have tried just setting
    strSubject = Request.Form("subject")
    strSubject = "my Subject"

    any that works the email subject is set correctly.. Just not when I try and get a form value...

    Strange hey??
  8. #5
  9. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2004
    Location
    Manchester, UK
    Posts
    314
    Rep Power
    11
    Remove this from your form tag and try it.

    enctype="multipart/form-data"
    Manny

    Web Design Manchester - Web Design Manchester
    Had an accident? - Accident Claim Group
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2002
    Location
    Canberra, Australia
    Posts
    348
    Rep Power
    13
    Originally Posted by manny786
    Remove this from your form tag and try it.

    enctype="multipart/form-data"
    thanks for that,, yep working now..

    Now I will Google multipart/form-data and see what and why and how about it.. Thanks all for your assistance
  12. #7
  13. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2004
    Location
    Manchester, UK
    Posts
    314
    Rep Power
    11
    the enctype is used when uploading images/documents ect
    Manny

    Web Design Manchester - Web Design Manchester
    Had an accident? - Accident Claim Group

IMN logo majestic logo threadwatch logo seochat tools logo