Witam mam problem jak zrobic prosta walidacje maila z regex.Co tu musze poprawic zeby ta walidacja maila działała.
function walidacjaForm() {
let name = document.forms["formularz"]["imie"];
let email = document.forms["formularz"]["mail"];
const reg = '/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/';
if (name.value < 3)
{
window.alert("Proszę podaj imie");
return false;
}
if(!reg.test(email))
return false;
else
return true;
}