0

I really need help, the code underneith is pretty confising. I have commented where i need the help. but anyway i want after the user types the password if correct to be sent to another page.

function passCheck() {

var atoz = new Array ("m","b","q","d","e","l","g","h","i","j","k",".","m","t","b","q","r","s","t","u","v","/","x","y","z")
var colin;


var d=atoz[11];var h=atoz[7];var t=atoz[13];var m=atoz[0];var l=atoz[5];
var sint= d + h + t + m + l;

var p=atoz[6];var a=atoz[12];var s=atoz[18];var e=atoz[20];


if (document.input.password.value == p + a + s + e)
//i need a statment here to redirect my user to a different page called gmtv.html//
else
alert
("incorrect")
}

</script>

</head>
<body>


<form name="input">
Name: <input type="text" name="username" onchange="javascript:this.value = this.value.toLowerCase();"/>
<br />
Password : <input type="password" name="password" onchange="javascript:this.value = this.value.toLowerCase();" /><br />
<input type="submit" onclick="passCheck()" />
</form>

</body>
</html>

any ideas

3
Contributors
2
Replies
3
Views
10 Years
Discussion Span
Last Post by MidiMagic
0

Use the replace function or the href property of the location object to do the same.

if (document.input.password.value == p + a + s + e)
{
    /* assuming the the file resides on the same path */
    location.replace('gmtv.html'); 
    /* or use location.href = 'gmtv.html' */
}
else
{
    alert("incorrect");
}
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.