I'm trying to trigger 1 of 2 different cgi scripts based on the username that the person enters into a form - everything seems to be working fine (the user-specific url stings are getting built just fine) in the below code, except that when I try to do window.location.replace from inside one of the if statements of the pickdirection()function, nothing happens . . . why oh why is this . . .
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="GENERATOR" CONTENT="Mozilla/4.01 [en] (Win95; I) [Netscape]">
<TITLE>Highway M Client Login</TITLE>
</HEAD>
<FORM method=post onSubmit="return pickdirection(form1)" name="form1" >
<table border=0>
<tr><td>
Username</td><td><INPUT type=text name="user" size=20></td></tr>
<tr><td>
Password</td><td><INPUT type=password name="password" size=20></td></tr>
</table>
<p>
<INPUT type="Submit" name="pass" Value=" Click to Login ">
</FORM>
<script>
function pickdirection(form) {
var url_2;
var user_variable;
user_variable = form.user.value;
var password_variable;
password_variable = form.password.value;
if (form.user.value == "mrussell"){
window.location.replace(" alert("got here");}
else if (form.user.value != "mrussell") {
url_2 = " alert(url_2);
}
}
//-->
</script>
</BODY>
</HTML>
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="GENERATOR" CONTENT="Mozilla/4.01 [en] (Win95; I) [Netscape]">
<TITLE>Highway M Client Login</TITLE>
</HEAD>
<FORM method=post onSubmit="return pickdirection(form1)" name="form1" >
<table border=0>
<tr><td>
Username</td><td><INPUT type=text name="user" size=20></td></tr>
<tr><td>
Password</td><td><INPUT type=password name="password" size=20></td></tr>
</table>
<p>
<INPUT type="Submit" name="pass" Value=" Click to Login ">
</FORM>
<script>
function pickdirection(form) {
var url_2;
var user_variable;
user_variable = form.user.value;
var password_variable;
password_variable = form.password.value;
if (form.user.value == "mrussell"){
window.location.replace(" alert("got here");}
else if (form.user.value != "mrussell") {
url_2 = " alert(url_2);
}
}
//-->
</script>
</BODY>
</HTML>