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
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:5821
Subscription: http://www.houseoffusion.com/groups/cf-newbie/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-newbie/unsubscribe.cfm