I want there to only be one at sign allowed in the email address and also to only contain ( a-z,A-Z, underscores (_), dot(.) and dash (-)). This is what i have so far. Thanks
var email = document.forms["register"]["email"].value;
var atpos = email.indexOf("@");
var dotpos = email.lastIndexOf(".");
if (atpos < 3 || dotpos < atpos + 4 || dotpos + 2 >= email.length)
{
alert("You have not entered a valid Email address, please check for mistakes and re-submit");
return false;
}