Form Element Submission Order

Results 1 to 2 of 2

Thread: Form Element Submission Order

  1. #1
    Join Date
    Dec 1969

    Default Form Element Submission Order

    Is there an order to which form elements are submitted through the form handler?<BR><BR>I am using a form with around 40 checkboxes in it where users select particular fields they want displayed. I need to be able to set the order of the checkboxes in order to do some formatting on the next page.<BR><BR>Ex - user selects checkbox a, b, and c. I want to display the values of (a,b,c) in (a,c,b) order. Can I do this without hardcoding the results page - i.e. is there a way for me to determine the order of the submitted elements?<BR><BR>Thanks,<BR><BR>Bill

  2. #2
    Join Date
    Dec 1969

    Default RE: Form Element Submission Order

    This is in one of the FAQs. I think the one run by Bertrand of the Microsoft ASP Newsgroup.<BR><BR>Anyway...<BR><BR>Remember, Request.Form is a *collection*, which means that it is essentially like a Scripting.Dictionary. When you do a <BR>&nbsp;&nbsp;&nbsp;&nbsp;For Each item In Request.Form<BR>you are getting the items back in hash-key order.<BR><BR>The secret is to bypass the "collection" aspect of Request.Form.<BR><BR>It&#039s been a while, but I *believe* it goes like this:<BR><BR>For i = 1 to Request.Form.Count<BR>&nbsp;&nbsp;&nbsp;&nbsp;fiel dName = Request.Form.Key(i)<BR>&nbsp;&nbsp;&nbsp;&nbsp;fie ldValue = Request.Form.Item(i) <BR>Next<BR><BR>*************** <BR><BR>HOWEVER! I once discovered that there is a limit on even *this* working. I kind of remember that it stops working after some power of two number of items in the form. I want to say 256, but it might be only 64.<BR><BR>I would guess that it stops working when you get to the point where the hashbuckets have to overflow into extents. But that&#039s purely a guess.<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