@nikkuv
Posted
First, apply all error styles with a class to the element, then select the element in js DOM and add that class to the element using the email regex function with conditionals. For email validation, you can use this email regex function👇
function validateEmail(email) {
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,}))$/;
return re.test(String(email).toLowerCase());
}
@SankThomas
Posted
@nikkuv Nice. Thank you