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 &quot;Center on
Aging&quot;, 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]

Reply via email to