Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 5937 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted (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 by Guest
Posted

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

Posted

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/

Posted

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

Posted

Thanks Guys,

Much more simpler to understand...the way I like to code!

Posted

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?

Posted

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.