> I am trying to loop through valid ID's (some ID's are "unlocked" and some
> are "locked" the user could only choose unlocked id's.) I than am
comparing
> them them to see which ones were checked. And appending them to a list to
be
> used later:
>
> <CFLOOP QUERY="GetValidId">
> <!--- this isdefined does not work --->
>     <cfif isdefined("#form.#id##")>
> <cfset idlist = idlist & '#id#,'>
> </cfif>
> </CFLOOP>

The IsDefined() line should look like...

<CFIF IsDefined("FORM." & ID)>

or

<CFIF IsDefined("FORM.#ID#")>

I prefer the former because it just looks cleaner, and from what I
understand CF executes code faster when it doesn't have to parse the # signs
out of the strings.  I could be wrong on that point, but it's my own
preferred method.

Also, you probably need to place an identifier in front of the dynamic form
field name, like name="chk_#ID#" instead of just name="#ID#" .. that will
eliminate any problems evaluating the variable in CF.  That actually may be
the reason you're having trouble with it at all.  I remember doing something
very similar and it freaked out because the variable name started with an
integer, so I've always placed a text identifier in front and have not had
any problems since.

_______________________________________

Justin Scott :: [DtDNS Administrator]
http://www.dtdns.com


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to