Ah Okay, I'm assuming that these fields were submitted by a form and are in the
'FORM' scope. If they are not, you could simply build your own variable that
has a list of the fieldnames (without the pound signs like you have below).
Here's what you need to do:
<cfloop list="#form.fieldnames#" index="fieldname">
<cfset "error#fieldName#" = "here is your error message, the error value is:
#evaluate('form.'&fieldname)#">
</cfloop>
So the trick is to include the entire variable name within the quotes on the
left hand side of the cfset statement.
The evaluate function takes the string form of the variable name and then
'evaluates' it to produce the value. If that variable doesn't exist, then it
will throw an error.
Dave
-----Original Message-----
From: Rob Voyle [mailto:[email protected]]
Sent: Thursday, March 08, 2012 8:53 AM
To: cf-newbie
Subject: Re: cfloop list
Hi Dave
Actually that doesn't work because checkvariables yields the specific illegal
character that has been found. What I want is the list variable. something like
<cfset "error" &#list# = "this is the error message.">
to yield
<cfset erroremailaddress="this is the error message">
but the &#list# doesn't work or any variation I have thought of.
Thanks
Rob
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive:
http://www.houseoffusion.com/groups/cf-newbie/message.cfm/messageid:5812
Subscription: http://www.houseoffusion.com/groups/cf-newbie/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-newbie/unsubscribe.cfm