Expandir la barra de logros de la comunidad.

Applications for the 2024-2025 Adobe Experience Manager Champion Program are open!

problem with a pattern

Avatar

Antiguo miembro de la comunidad
I have a problem with a pattern.

I want to put a patter to validate an e-mail but i don´t find the way to do it
2 Respuestas

Avatar

Antiguo miembro de la comunidad
Hi Veloki,

You can drag and drop custom "email Adress" object from Custom Object Library. It includes the script for email validation in the validate event of email area.



// Validate the email address.

var r = new RegExp("^[a-z0-9_\\-\\.]+\\@[a-z0-9_\\-\\.]+\\.[a-z]{2,3}$"); // Create a new Regular Expression Object.

// Set the regular expression to look for an email address in general form.



var result = r.test(this.rawValue); // Test the rawValue of the current object to see



// if it fits the general form of an email address.

if (result == true) // If it fits the general form,

true; // all is well.

else // Otherwise,

false; // fail the validation.



Asiye

Avatar

Antiguo miembro de la comunidad
thank you very much :)