Here it is... As basic as can be. ;^)
M!ke
<cfcomponent displayname="ErrorHandler" output="no">
<cffunction name="init" returntype="errorhandler" access="public"
output="no">
<cfset variables.instance = structNew()>
<cfset variables.instance.errors = arrayNew(1)>
<cfreturn this>
</cffunction>
<cffunction name="addError" returntype="void" access="public"
output="no">
<cfargument name="errorDescr" type="string" required="yes">
<cfargument name="errorKey" type="string" required="no" default="">
<cfset var tempVar = structNew()>
<cfset tempVar.description = arguments.errorDescr>
<cfset tempVar.key = arguments.errorKey>
<cfset arrayAppend(variables.instance.errors, tempVar)>
</cffunction>
<cffunction name="getErrors" returntype="array" access="public"
output="no">
<cfreturn variables.instance.errors>
</cffunction>
<cffunction name="hasErrors" returntype="boolean" access="public"
output="no">
<cfreturn yesNoFormat(arrayLen(variables.instance.errors))>
</cffunction>
<cffunction name="getInstanceData" returntype="struct" access="public"
output="no">
<cfreturn variables.instance>
</cffunction>
</cfcomponent>
________________________________
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Ung, Seng
Sent: Wednesday, May 11, 2005 2:00 PM
To: [email protected]
Subject: RE: [CFCDev] Form Validation
Mike:
I like to see an example for this? if you have sometime to cook
it up for us.
thanks
seng
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to
[email protected] with the words 'unsubscribe cfcdev' as the subject of the
email.
CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting
(www.cfxhosting.com).
CFCDev is supported by New Atlanta, makers of BlueDragon
http://www.newatlanta.com/products/bluedragon/index.cfm
An archive of the CFCDev list is available at
www.mail-archive.com/[email protected]