How to add email validation for enter valid email on input
Application Type
Reactive

I want to show validation message like enter valid email address. What condition or expression I need to add on input of email. Remember my data type for email attribute in entity is text.

Hi,

Use the Outsystems "EmailAddressValidate()" function to validate the email.


Is that function code visible so I can watch that.

Other way is you can try regular expression:

https://stackoverflow.com/questions/46155/how-to-validate-an-email-address-in-javascript

mvp_badge
MVP
Solution

Hi Yogesh Javir,

I create a example, look in .OML attachment.

Hope this helps.

Regards.


ValidateEmailDemo.oml

Hi,

Use the Outsystems "EmailAddressValidate()" function to validate the email.


Is that function code visible so I can watch that.

Other way is you can try regular expression:

https://stackoverflow.com/questions/46155/how-to-validate-an-email-address-in-javascript

mvp_badge
MVP
Solution

Hi Yogesh Javir,

I create a example, look in .OML attachment.

Hope this helps.

Regards.


ValidateEmailDemo.oml

mvp_badge
MVP

I'm glad I could help!

The following JavaScript shows how to validate email address using Regular Expression .

 

function validateEmail(inText){

  const re = /^(([^<>()\[\]\\.,;:\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,}))$/;

  var email=document.getElementById(inText).value;

  if(re.test(String(email).toLowerCase()))

  {

    alert("Email is valid  : " + email);

  }

  else

  {

    alert("Email is not valid  :  " + email);

  }

}





Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.