How Can We Help?

Search for answers or browse about Sintel Forms.

Validate email addresses

You are here:

Scenario

Let’s say that you have a field named  ‘Email’ which you use to capture an email address and you want to ensure that users enter a valid email address.

Solution

This can be accomplished by adding a simple rule within the Logic screen that validates the contents of the ‘Email’ field.

  1. Title: Email format validation
  2. Conditions: Custom js function
  3. Steps: Field – set custom error

 

Code

let emailRegExp = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/g;
getValue('Email').match(emailRegExp) == null​

 

Example

 

Once you have configured this it should work like this:

 

 

Was this article helpful?
0 out of 5 stars
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
How can we improve this article?
Please submit the reason for your vote so that we can improve the article.
Table of Contents