Hi Everyone! Does anyone know what validations Netsuite uses for customer's email field, I need to put same validation on my other application so that user enter email which is acceptable in Netsuite. Thanks
s
Sai Krishna
06/05/2024, 12:26 PM
You can use this function.
const validateEmail = (email) => {
return String(email)
.toLowerCase()
.match(
/^(([^<>()[\]\\.,;:\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,}))$/
);
};
Sai Krishna
06/05/2024, 12:27 PM
It should not return null.
b
battk
06/05/2024, 3:08 PM
you can take a look at what the client side validation for the email address looks like on the source of whatever page you are trying to match