House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home / Groups / ColdFusion Newbie (CF-Newbie)

cfloop list

Author:
Andrew Scott
03/13/2012 02:00 PM

That's fair enough, just wanted to give you a much better alternative. Evaluate is also not very fast when running, in comparison to other ways to do. Although it has gotten some major speed boosts over the years, I would tend to use it at the utmost last resort. -- Regards, Andrew Scott WebSite: http://www.andyscott.id.au/ Google+: http://plus.google.com/108193156965451149543 > > Hi Andrew > > The main reason I haven't used the #form# is that I am essentially > ignorant of > cfloops and many other CF things like collections objects etc. I am only > recently > pushing my way out of my self-taught bubble. With Dave's help I managed to > get the thing to run quite well by creating a list of the items I need to > test. > The trick was to access the variables name as well as its value. > > Here is what I did: > <cfset variableNames= > list="emailAddress, > nameTitle, > nameFirst, > nameLast, > etc, > phone"> > > <cfset errorData="0"> > <cfset errorDataMessage=""> > > <cfloop list="#variableNames#"  index="variableNames" delimiters = ","> > <cfif REFind('[<>_~##^*+={}/|\\\[\]]', evaluate(variableNames))> > > <cfset errorVariableName=reReplace(variableNames,chr(13),"", "all" )> > <cfset errorVariableName=reReplace(errorVariableName,chr(10),"", "all" )> > > <cfset errorData=1> > <cfset errorDataMessage="<h3>You have an illegal character in one of the > fields</h3>"> > <cfset "error#errorVariableName#"= "<h3>You cannot use """ & > evaluate(VariableNames) & """  in this entry</h3>"> >        </cfif> > </cfloop> > > Rob > Robert J. Voyle, Psy.D. > Director, Clergy Leadership Institute > For Coaching and Training in Appreciative Inquiry > Author: Restoring Hope: Appreciative Strategies >             to Resolve Grief and Resentment > http://www.appreciativeway.com/ > 503-647-2378 or 503-647-2382 > > > > >


Search cf-newbie

May 22, 2013

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
       1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31   

Designer, Developer and mobile workflow conference