Hi Everyone.
I am fairly new to javascript and wanted to do a small site that basically has a form where you select your name from a drop down menu, insert your password in the password box and press log in, the page then quickly checks if the inputed password matches the one stored and if it does it automatically redirects to another page (which in this case is the user's personal page)
What i have written at the moment is :
<script type="text/javascript">
function verify(menu,pass){
var setpass = "a";
var lowpass = pass.toLowerCase();
if(menu == "Alex" && lowpass == setpass){
alert("APROVED");
window.location = "Alex_main.html";
}
else{
alert("ERROR");
}
}
</script>
It Shows the alerts but it does not redirect to the page, i am unsure why...
Here is the form i am using:
<form name="LogIn1" method="post">
<table>
<tr>
<td><select name="URLselect">
<option selected value="Alex">Alex
</select></td>
</tr>
<tr>
<td><input type="password" name="pwdPassword" size="12" /></td>
</tr>
<tr>
<td><input type="button" onClick="verify(document.LogIn1.URLselect.value,document.LogIn1.pwdPassword.value)" value="Log in" /></td>
</tr>
</table>
</form>
What i basically want it to do is check if the password matches with the one that has been previously declared and if it does to redirect the user to his page.
(this is for more or less personal use , in other words i dont see it ending up beeing hosted on the internet. I want to use it as a desktop background site for quick access.)
Also if its not too much trouble, i wanted to ask, is there a way that i can somehow record the logins?
So that for example i can come and see that John has logged in 5 times and Alex has logged in 2 times.
That would be very helpfull!
Thanks in Advance
-- Roiie