Well I have this code :
<html>
<title</title>
<head>
<script Language="JavaScript">
function check_email(check) {
ok = "1234567890qwertyuiop[]asdfghjklzxcvbnm.@-_QWERTYUIOPASDFGHJKLZXCVBNM";
for(i=0; i < e.length ;i++){
if(ok.indexOf(e.charAt )<0){
return (false);
}
}
/*function isEmailAddr(email)
{
var result = false
var theStr = new String(email)
var index = theStr.indexOf("@nackademin.com");
if (index > 0)
{
var pindex = theStr.indexOf(".",index);
if ((pindex > index+1) && (theStr.length > pindex+1))
result = true;
}
return result;
}*/
function FormValidator(theForm)
{
if (theForm.email.value == "" || ! "@nackademin.com")
{
alert("Please enter a valid emailadress in the \"email\" field.");
theForm.email.focus();
return (false);
}
if (!isEmailAddr(theForm.email.value))
{
alert("Please enter a complete email address in the form:
[email protected]");
theForm.email.focus();
return (false);
}
if (theForm.email.value.length < 3)
{
alert("Please enter at least 3 characters in the \"email\" field.");
theForm.email.focus();
return (false);
}
return (true);
}
</script>
</head>
<body>
<form method="POST" action="feedback.html" onsubmit="return FormValidator(this)" id=form4 name=form4>
<p>Email Address: <input type="text" name="email" size="32"><input type="submit"
value="Submit" name="submit"></p>
</form>
</body>
</html>
This code has to check if the mail is sent either to
www.nackademin.com or to
www.lexikon.se and that there is at least one letter before the @ , no numbers! and if there's an @ in the address.
Can someone check this out and tell me what to do?