Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

validate email

Featured Replies

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

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

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/

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

  • Author

Thanks Guys,

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

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?

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

Awesome, thanks a lot :

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.