wilsonmartin
03-16-2005, 02:21 PM
Hello everyone,
I am trying to do a username login for my webpage with Javascript and I can only get one user in, I have tried to add on various other users and it does not work. Could anyone lend me a hand in figuring this out, I want to add other usernames and passwords and I simply am not accomplishing it. Whoever can help me I would greatly appreciate it.
God Bless!
Will
Here is the Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Javascript Test</title>
<style type="text/css">
<!--
.style1 {
font-family: Arial, Helvetica, sans-serif;
font-size: 10px;
}
-->
</style>
</head>
<body class="style1">
<form>
<p>ENTER USER NAME :
<input type="text" name="text2">
</p>
<p> ENTER PASSWORD :
<input type="password" name="text1">
<br>
<input type="button" value="Check In" name="Submit" onclick=javascript:validate(text2.value,"free",text1.value,"javascript") >
</p>
</form>
<script language = "javascript">
function validate(text1,text2,text3,text4)
{
if (text1==text2 && text3==text4)
load('http://www.yahoo.com');
else
{
load('failure.htm');
}
}
function load(url)
{
location.href=url;
}
</script>
</body>
</html>
I am trying to do a username login for my webpage with Javascript and I can only get one user in, I have tried to add on various other users and it does not work. Could anyone lend me a hand in figuring this out, I want to add other usernames and passwords and I simply am not accomplishing it. Whoever can help me I would greatly appreciate it.
God Bless!
Will
Here is the Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Javascript Test</title>
<style type="text/css">
<!--
.style1 {
font-family: Arial, Helvetica, sans-serif;
font-size: 10px;
}
-->
</style>
</head>
<body class="style1">
<form>
<p>ENTER USER NAME :
<input type="text" name="text2">
</p>
<p> ENTER PASSWORD :
<input type="password" name="text1">
<br>
<input type="button" value="Check In" name="Submit" onclick=javascript:validate(text2.value,"free",text1.value,"javascript") >
</p>
</form>
<script language = "javascript">
function validate(text1,text2,text3,text4)
{
if (text1==text2 && text3==text4)
load('http://www.yahoo.com');
else
{
load('failure.htm');
}
}
function load(url)
{
location.href=url;
}
</script>
</body>
</html>