Daniel,
This may help:
<cfset the_dept = "">
<cfloop list="aging,fmst,knes,dean,pch,studserv" index="ii">
<cfif structKeyExists(form, ii)>
<cfset listAppend(the_dept, form[ii], "|")>
</cfif>
</cfloop>
-joe
----- Original Message -----
From: Daniel Kessler <[EMAIL PROTECTED]>
Date: Wed, 25 Aug 2004 14:58:17 -0400
Subject: looping through checkboxes
To: CF-Talk <[EMAIL PROTECTED]>
I'm trying to do a cfloop to go through a set of checkboxes by an
array of their names and if they're define, then take their value and
make an appended string. If a variable is missing, it dies on the
isDefined and also did so with parameterExists with this error
"Parameter 1 of function IsDefined, which is now "Center on
Aging", must be a syntactically valid variable name. " The
value that it complains about is the checkboxes "value" but I was
trying to get the variable name in there through the evaluation.
Here's the code:
<cfset the_dept = "">
<cfset departments = listToArray("aging,fmst,knes,dean,pch,studserv")>
<cfloop index="ii" from="1" to="6">
<cfif isDefined(evaluate(departments[ii]))>
<cfset the_dept = #the_dept#&"|"&#tmp_dept#>
</cfif>
</cfloop>
--
Daniel Kessler
Department of Public and Community Health
University of Maryland
Suite 2387 Valley Drive
College Park, MD 20742-2611
301-405-2545 Phone
www.phi.umd.edu________________________________
[Todays Threads]
[This Message]
[Subscription]
[Fast Unsubscribe]
[User Settings]
[Donations and Support]
- looping through checkboxes Daniel Kessler
- Re: looping through checkboxes Chris Stoner
- Re: looping through checkboxes Patricia Lee
- Re: looping through checkboxes Matthew Fusfield
- Re: looping through checkboxes Joe Rinehart
- Re: looping through checkboxes Ben Doom
- Re: looping through checkboxes daniel kessler
- Re: looping through checkboxes Matthew Fusfield
- Calculating Sales Tax within the US Brook Davies
- Re: Calculating Sales Tax within the US Bryan Stevenson
- Re: Calculating Sales Tax within the US Dick Applebaum
- RE: Calculating Sales Tax within the US Andy Ousterhout
- Re: Calculating Sales Tax within the US Jim McAtee
- RE: Calculating Sales Tax within th... Andy Ousterhout