Jalz Posted October 20, 2008 Posted October 20, 2008 (edited) Hello All, Does anyone know of any slick code I can use to validate the user is inputting in email addresses correctly? Thanks Jalz P.S I found a custom function on Briandunnings website, but this was written 2005....anything newer Edited October 20, 2008 by Guest
Orlando Posted October 20, 2008 Posted October 20, 2008 Hi Jalz Here is a very simple Custom Function I use for this. It simply checks there is an @ symbol before a period ".". [color:blue]xCF_EmailValidationBasic ( email ) Let ( [ Filtered = Lower ( Filter ( email ; "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.@POSSABLE_USAGE{}~^?=/*'&" ) ) ; LocationAT = Position ( Filtered ; "@" ; 0 ; 1 ) ; LocationPeriod = Position ( Filtered ; "." ; LocationAT ; 1 ) // Locate the period, but only if it is after the @ symbol. ] ; // Start Calculation If ( LocationAT ≥ 1 and LocationPeriod ≥ 2 ; 0 ; 1 ) // End of If statement ) // End of Let statement I hope this helps -- Orlando
comment Posted October 20, 2008 Posted October 20, 2008 It simply checks there is an @ symbol before a period "." I believe that could be done by just: Let ( at = Position ( email ; "@" ; 1 ; 1 ) ; at and Position ( email ; "." ; at ; 1 ) ) Alas, there's much more to e-mail validation than that: http://fmforums.com/forum/showtopic.php?tid/169681/
Orlando Posted October 20, 2008 Posted October 20, 2008 Quite right Comment, I actually posted the wrong function. It does not need the reformatting at the start, but yours is still simpler. Thanks -- Orlando
Jalz Posted October 20, 2008 Author Posted October 20, 2008 Thanks Guys, Much more simpler to understand...the way I like to code!
Anuviel Posted October 20, 2008 Posted October 20, 2008 If I am not mistaken this will only validate if there is a @ in the field? If I wanted to have stricter checking what would be the easiest way to restrict the input of text so that it needs to end in .com, .net, .us and so on and so forth?
LaRetta Posted October 20, 2008 Posted October 20, 2008 Well, I haven't had the need to check for email addresses for awhile but when I did, I used this one (file attached). It was created by Kent Searight, 3rd Rock Data, LLC, 5/8/2006. It allows updating the extensions via a website just by selecting all and pasting into the field. You can tell by the date that it was before web viewer as well. But that website could be used to keep the extensions up to date. Email_Invalidity_Tester.zip
Recommended Posts
This topic is 5937 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now