mailform.asp faq -- sending form elements in order

Results 1 to 3 of 3

Thread: mailform.asp faq -- sending form elements in order

  1. #1
    Join Date
    Dec 1969

    Default mailform.asp faq -- sending form elements in order

    Hi, <BR><BR>I&#039ve just been going over the mailform.asp FAQ on this site which is a quick and easy way to send mail from any form. At the end of the FAQ, there is a link to info on how to make sure that in the email, the form elements are sent in order (<BR><BR>The explanation on how to do this isn&#039t targeted directly at the code from the mailform.asp script, and it leaves me confused. Can anyone help me translate this explanation into something that works with the mailform.asp script (<BR><BR>Thanks!<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: mailform.asp faq -- sending form elements in o

    Try This, should work (UNTESTED).<BR><BR>Replace the block of code that starts with &#039Dim myElement&#039 with the following.<BR><BR><BR><BR>Dim ix, fieldName, fieldValue<BR>For ix = 1 To Request.Form.Count<BR> fieldName = Request.Form.Key(ix)<BR> fieldValue = Request.Form.Item(ix) <BR><BR> Select Case Left(fieldName,3)<BR> Case "txt","sel","rad":<BR> strBody = strBody & Replace(Mid(fieldName,4,len(fieldName)),"."," ") & _<BR> ": "<BR> if Len(fieldValue) = 0 then<BR> strBody = strBody & "UNANSWERED"<BR> else<BR> strBody = strBody & fieldValue<BR> end if<BR><BR> strBody = strBody & vbCrLf<BR><BR> Case "chk":<BR> strBody = strBody & Replace(Mid(fieldName,4,len(fieldName)),"."," ") & _<BR> ": " & fieldValue & vbCrLf<BR> End Select<BR> Next<BR><BR>Next<BR>

  3. #3
    Richard Smith-+ Guest

    Default mailform.asp faq -- Sorting works with this amend!

    The script ammendment from Shannon works. It seems that the last Next is not required.<BR><BR>Although it was not me who asked, thanks for this. My forms work now and are sorted in the order they are in the original form.<BR><BR>

Posting Permissions

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