Question
isValid() Email Validation
I am somewhat new to CF and am trying to understand the logic
behind the Email validation isValid(). From all of my searching I
found there are 2 ways to do this. Listing the incorrect emails as
arrays or just listing the string.
here is what I have:
<cfif isdefined("form.email")>
<cfif not isValid("regEx",Trim(form.email),"^[\w](([_\.\-]?[\w]+)*)@([\w]+)(([\.\-]?[a-zA-Z0-9]+)*)\.([A-Za-z]{2,4}$)")>
Please provide your email address. <a href="javascript:history.back()">Back</a>
<cfabort>
</cfif></cfif>
What am I doing wrong and what is the best way to write the isValid() code?
Thank you
here is what I have:
<cfif isdefined("form.email")>
<cfif not isValid("regEx",Trim(form.email),"^[\w](([_\.\-]?[\w]+)*)@([\w]+)(([\.\-]?[a-zA-Z0-9]+)*)\.([A-Za-z]{2,4}$)")>
Please provide your email address. <a href="javascript:history.back()">Back</a>
<cfabort>
</cfif></cfif>
What am I doing wrong and what is the best way to write the isValid() code?
Thank you