I can’t get this function to work out… all i want is a login thing. I know that it will be insecure, but that is okay for my purposes. all i need is help on how to get this code to work…
Here is the code:
<html>
<head>
<title>Login</title>
<SCRIPT LANGUAGE = “JavaScript”>
var arrUn = new Array(“Joe”, “Earl”, “Bob”, “Chris”, “Fred”);
var arrPw = new Array(“haha”, “hoho”, “heehee”, “hoohoo”, “harhar”);
function fnclog(namey, passy);
{
for(i = 0, i < arrUn.length, i++)
{
if(arrUn[i].toLowerCase==namey.toLowerCase)
{
asky=prompt(“Password?”);
if(asky.toLowerCase==arrPw[i].toLowerCase)
{alert(“Correct”)};
else{alert(“Name not recognized”)}
else{alert(“Name not recognized.”)}
}}
</script>
<body>
<form name=”form1″>
<b>Username:</b>
<input type=”text” name=”text1″>
<br>
<input type=”button” value=”Login” style=”background: ‘aqua'”
onClick=”fnclog(this.form.text1.value, this.form.pass1.value);”>
</form>
</body>
</html>