My code looks like this (simplified version):

<cfcomponent>
<cffunction name="addEmail" access="remote" returntype="string">
<cfargument name="emailAddress" required="yes"
type="string" default="">

<cfscript>
function IsEmail(str)
{
    //supports new top level tlds
if
(REFindNoCase("^['_a-z0-9-]+(\.['_a-z0-9-]+)[EMAIL PROTECTED](\.[a-z0-9-]+)
\.(([a-]{2,3})|(aero|coop|info|museum|name))$",str)) return TRUE;
else return FALSE;
}
</cfscript>

<cfif IsEmail(arguments.emailAddress)>

<cftry>
<cfquery...>
</cfquery>
<cfcatch></cfcatch>
</cftry>
</cfif>

<cfreturn returnVar>
</cffunction>
</cfcomponent>

Is that incorrect?  Let me know.

John Burns

-----Original Message-----
From: Raymond Camden [mailto:[EMAIL PROTECTED]
Sent: Friday, May 07, 2004 9:21 AM
To: CF-Talk
Subject: RE: UDF in Component?

You can place a UDF in the component, but it will be treated like a
method.
Tell me - how are you calling the function?
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to