Stephen,
What I did was to produce a string of it, with ones and zeroes, and the
different parameters alphabetically like "101010012". This generated through
a loop of the different checkboxes alphabetically. Not a very beautiful
solution, but it works. Since it is a session var, it shouldn't matter too
much if you later add or delete on checkbox (if it was a client var, then
that would screw up that string...)
/Hugo
-------------------------------------------------------------
Hugo Ahlenius E-Mail: [EMAIL PROTECTED]
Project Officer Phone: +46 8 7410451
UNEP GRID-Arendal Fax: +46 733 403285
Stockholm Office Mobile: +46 733 467111
WWW: http://www.grida.no
-------------------------------------------------------------
| -----Original Message-----
| From: Adams, Stephen [mailto:[EMAIL PROTECTED]]
| Sent: Monday, July 22, 2002 12: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.
| **********************************************************************
|
|
______________________________________________________________________
This list and all House of Fusion resources hosted by CFHosting.com. The place for
dependable ColdFusion Hosting.
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