Problem Returning Form Results in Order They Appea

Results 1 to 3 of 3

Thread: Problem Returning Form Results in Order They Appea

  1. #1
    Join Date
    Dec 1969

    Default Problem Returning Form Results in Order They Appea

    Could someone look at the following code and show me what I would change to swap a *For Each ... Next* into *For ... Next* in order that my mail form will return the results in the order they appear on the html form? <BR><BR>I know I need to replace the For Each myElement in Request.Form, but with what? <BR><BR> &#060;!-- Code Starts Here <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> if Len(Request.Form(myElement)) = 0 then <BR> strBody = strBody & "UNANSWERED" <BR> else <BR> strBody = strBody & Request.Form(myElement) <BR> end if <BR> <BR> strBody = strBody & vbCrLf <BR> <BR> Case "chk": <BR> strBody = strBody & Replace(Mid(myElement,4,len(myElement)),"."," ") & _ <BR> ": " & Request.Form(myElement) & vbCrLf <BR><BR> End Select <BR> <BR> Next <BR><BR> Ends Here --&#062; <BR><BR> Can&#039;t quite seem to get it to work as stated elsewhere on this site. <BR><BR> Thanks

  2. #2
    PJ Guest

    Default RE: Problem Returning Form Results in Order They A

    If you can come up with a way to count the number of "myElements" from the preceding page, you can pass that numeric value as a hidden form element:<BR><BR>&#060;input type="hidden" name="elementCount" value="7"&#062;<BR><BR>...then use it as follows:<BR><BR>====================<BR>numLoops = Request("elementCount")<BR>For i = 1 to numLoops<BR>&nbsp;&nbsp;&nbsp;guts here...<BR>Next<BR>====================<BR><BR>I use this often and it works like a dream<BR><BR>Hope this helps.<BR>PJ

  3. #3
    Join Date
    Dec 1969

    Default ASPFAQs, category FORMS

    The link to the ASPFAQs is at the top right corner of this page.<BR><BR>Please do look in the ASPFAQs from time to time!<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