Can someone please advise what I may be missing? How can I not only make it better, but this does not seem to be working, although 1 domain instance has worked for some time, I tried adding to it:
if(document.form1.email.value.length > 0) {
var theEmail = document.form1.email;
var at = theEmail.value.indexOf('@');
var period = theEmail.value.lastIndexOf('.');
var space = theEmail.value.indexOf(' ');
var length = theEmail.value.length - 1;
var mlcom = theEmail.value.indexOf('ml.com');
var MLCOM = theEmail.value.indexOf('ML.COM');
if ((at < 1) ||
(period <= at+1) ||
(period == length ) ||
(space != -1) ||
(length <=period + 1))
{
alert("Please enter a valid e-mail address.");
document.form1.email.select();
return false;
} else if ((mlcom == -1) && (MLCOM == -1)){
alert ("Please enter an email address containing the phrase 'ml.com'.");
document.form1.email.select();
return false;
}
}