Hi

Hi

Perhaps you could create a structure using the form names as  keys
Then the structure would only consist of those which have been checked,
you could use functions to check if particular keys exist to determine
if a value is part of the structure and you can save this structure to
session scope quite easily.

HTH

Kola

-----Original Message-----
From: Adams, Stephen [mailto:[EMAIL PROTECTED]] 
Sent: 22 July 2002 11:25
To: CF-Talk
Subject: Setting a dynamically built list as a session variable.

**********************************************************************
WESTMINSTER CITY COUNCIL
Please refer to the disclaimer beneath this message
**********************************************************************

Hi,

I have a form page that creates a list of checkboxes that have been
populated by a loop.  Like this:

<cfloop query="get_bus_type">
        <tr>
                <td class="tablefeature"> #bus_type#</td>
                        <td width="80" align="center"
class="tablefeature"><input type="checkbox"
name="business_types#get_bus_type.currentRow#" value="#bus_type#" ></td>
        </tr>
</cfloop>

Each checkbox name has to have its own name as I am using a JavaScript
function to check and uncheck all of them at the same time.  So they
need to
be individually check by the JS function to see if they are checked or
not.
Here is my JS function:

<script language="JavaScript">
    <!-- Begin
    function checkAll() {
      for (var j = 1; j <= 17; j++) {
        box = eval("document.BusinessType.business_types" + j); {
        if (box.checked == false) {
            box.checked = true;
        } else if(box.checked == true){
            box.checked = false;
          }
        }
      }
    //  End -->
  </script>

In my action page I want to set all the passed/checked checkboxes as one
single session variable so it can be used later on in another page. 

My question is how can I create this session variable from this dynamic
list
of form variables?

Stephen


**********************************************************************
Westminster City Council switchboard: 
+44 20 7641 6000
**********************************************************************
This E-Mail may contain information which is 
privileged, confidential and protected from 
disclosure.  If you are not the intended recipient 
of this E-mail or any part of it, please telephone 
Westminster City Council immediately on receipt.
You should not disclose the contents to any other 
person or take copies.
**********************************************************************


______________________________________________________________________
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to