Session array

Results 1 to 2 of 2

Thread: Session array

  1. #1
    Join Date
    Dec 1969

    Default Session array

    I have got the following below<form action="respondSelect.asp" method="get"><select name="list" multiple size="3"> <option value="apple">apple</option> <option value="pear">pear</option> <option value="orange">orange</option> </select><input type="submit"></form>On respondSelect.asp I have this<%myArray = split(request.queryString("list"), " ,")Session("market_array") = myArraytempArray = Session("market_array") For x=0 to UBound(tempArray) response.write tempArray(x)Next %>Session("market_array") is set up to contain an array in Global.asa.At the moment I can only set up this session array to contain the items that are selected in the select box. However, I would like it to contain everything that is in the select box. Is there a simple way of doing this.All suggestions are welcome. Thanks!
    Last edited by Jay; 04-16-2011 at 01:20 AM.

  2. #2
    Join Date
    Dec 1969

    Default Request makes no sense...

    The whole *POINT* of having a &#060;SELECT&#062; on a form is that the next page will *only* get the item(s) that the user selected from the list!<BR><BR>If you want to remember all the items in the list, store the list in a session array *WHEN YOU CREATE THE SELECT*. On the page before!<BR><BR>That is, if you are using a query to create the OPTIONs for the SELECT, then use the same data to create the array you store. This *can* be especially easy: Use RecordSet.GetRows and just save the array that it returns in the Session!<BR><BR>But by the time you get to the point of doing Request.Form("mySelectFormField") it is way too late.<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