var y=document.forms["form"]["user"].value
if (y==null || y=="" )
{
alert("Username cannot be Blank");
return false;
};
var x = new Array();
x[0] = "bill";
x[1] = "ted";
x[2] = "jim";
for ( keyVar in x )
{
if (x==y)
{
alert("Username Taken");
return false;
};
};
How do I compare a variable to that in a JavaScript array, I managed to make the example above, but the second part, the bit I need, doesn't work. any ideas ?