Making a login Using JavaScript, Will Incorporate PHP Later
- by TIMOTHY
not sure why my code wont work, im teaching myself javascript i know php moderatly and i also know the intelligence of using java to hold a password and username, but at the moment i just want the script to work.
<html>
<head>
<title>34webs</title>
<link rel="stylesheet" href="css/lightbox.css" type="text/css" media="screen" />
<link rel="stylesheet" type="text/css" media="screen" href="main.css">
<script type="text/javascript" src="js/prototype.js"></script>
<script type="text/javascript" src="js/scriptaculous.js?load=effects,builder"></script>
<script type="text/javascript" src="js/lightbox.js"></script>
<script type="javascript" >
function logintry (){
var usern = document.logn.username.value;
var passw = document.logn.password.value;
if(usern == blue && passw == bluee){
alert('password is correct!');
}else{
alert('password is wrong');
}
}
</script>
</head>
<body>
<div id="bod">
<div id="nav">
<p id="buttonhead">34 web</p>
<a href="#" class="button">HOME</a>
<a href="#" class="button">NEWS</a>
<a href="#" class="button">DOWNLOADS</a>
<a href="#" class="button">ERA</a>
<a href="#" class="button">IE BROWSER</a>
<a href="#" class="button">DRIVERS</a>
<form name="logn">
<table style="margin:0 auto; background:#0174DF; color:white;">
<tr>
<td>
Username<br>
<input type="text"
name="username"
value="">
</td>
</tr>
<tr>
<td>
Password<br>
<input type="password"
name="password"
value="">
</td>
</tr>
<tr>
<td style="text-align:center;">
<input type="button"
name="Submit"
value="submit"
onclick= javascript: logintry()>
</td>
</tr>
</table>
</form>
</div>