willemvo
New Member
- Messages
- 19
- Reaction score
- 0
- Points
- 0
I've builded this poorly looking script,, but i need it so can anybody tell me what i did wrong with the array and the indexOf function... PLEASE HELP ME!!
thanks in advance
Code:
<html>
<head>
<title>TEST</title>
</head>
<body>
<SCRIPT language="JavaScript">
<!--
function emailcheck(form)
{
var email=form.email.value;
var c = new array();
c[0] = "hotmail";
c[1] = "home";
c[2] = "live";
var acheck=email.indexOf('@');
var dotcheck=email.indexOf('.');
var procheckhot=email.indexOf(c);
if ((acheck==-1) || (dotcheck==-1) || (procheckhot==-1))
{
alert("Error: FOUT!!!\n\tno @ or;\n\tno . or;\n\ta combination.");
emailcheck()
}
else
{
alert('Thanks!');
}
}
//-->
</SCRIPT>
<form>
<input type="text" name="email" value="your e-mail adress" /><input type="button" value="CHECK!!" name="button" onClick="emailcheck(this.form)" />
</form>
</body>
</html>