Sorry I'ma twat,

setSession(checkList)

function setSession(catchList){
        location.href = setSession.cfm?sessionData= + catchList
}

that will work

-----Original Message-----
From: John McCosker [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 22, 2002 11:53 AM
To: CF-Talk
Subject: RE: Setting a dynamically built list as a session variable.


Sorry once you have finisehd the loop,

call setSession,
        setSession(),

make checkList a global var and not a function dependent var,

j

-----Original Message-----
From: John McCosker [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 22, 2002 11:47 AM
To: CF-Talk
Subject: RE: Setting a dynamically built list as a session variable.


When you loop through in Javascript,
set a variable which will append the values of the checked
boxes,

I'm not sure which if block you want to do it in as you are unchecking
checked boxes and checking unchecked,
so I take it you mean the ones you are checking,

var checkList = ''

if (box.checked == false) {
            box.checked = true;
                if(checkList != ''){
                        checkList += "," + get the checkbox value
                }else{
                        checkList = "," get the checkbox value
                }
        } else if(box.checked == true){
            box.checked = false;
          }
        }

function setSession(checkList){
        location.href = setSession.cfm?sessionData= + checkList
}

session.cfm,

if you out put the url var,
say something like this,


url.checklist
1,2,3,4,5,6

<cfset session.checklist=url.checklist>

that should work

-----Original Message-----
From: Adams, Stephen [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 22, 2002 11:25 AM
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.
**********************************************************************




______________________________________________________________________
Get the mailserver that powers this list at http://www.coolfusion.com
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