Hello everybody,
I need a little help and I will appreciate is anybody can help me with that.
I need to set up a user logging and password in an external .js file
Here what I wrote:
my loggin.js
function loggin(){
var done=0;
var username=document.login.username.value;
username=username.toLowerCase();
var password=document.login.password.value;
password=password.toLowerCase();
if (username=="member1" && password=="eldi" { window.location="page1.htm"; done=1; }
if (username=="member2" && password=="password2" { window.location="page2.html"; done=1; }
if (username=="member3" && password=="password3" { window.location="page3.html"; done=1; }
if (done==0) { alert("Invalid login!" }
}
My HTML file
<form name=login>
<table width=225 border=1 cellpadding=3>
<tr><td colspan=2><center><font size="+2"><b>Members-Only Area!</b></font></center></td></tr>
<tr><td>Username:</td><td><input type=text name=username></td></tr>
<tr><td>Password:</td><td><input type=text name=password></td></tr>
<tr><td colspan=2 align=center><input type=button value="Login!" onClick="loggin()"></td></tr>
</table>
</form>
</center>
Please anybody can help me with that?
Thank you in advance,
Emilly
I need a little help and I will appreciate is anybody can help me with that.
I need to set up a user logging and password in an external .js file
Here what I wrote:
my loggin.js
function loggin(){
var done=0;
var username=document.login.username.value;
username=username.toLowerCase();
var password=document.login.password.value;
password=password.toLowerCase();
if (username=="member1" && password=="eldi" { window.location="page1.htm"; done=1; }
if (username=="member2" && password=="password2" { window.location="page2.html"; done=1; }
if (username=="member3" && password=="password3" { window.location="page3.html"; done=1; }
if (done==0) { alert("Invalid login!" }
}
My HTML file
<form name=login>
<table width=225 border=1 cellpadding=3>
<tr><td colspan=2><center><font size="+2"><b>Members-Only Area!</b></font></center></td></tr>
<tr><td>Username:</td><td><input type=text name=username></td></tr>
<tr><td>Password:</td><td><input type=text name=password></td></tr>
<tr><td colspan=2 align=center><input type=button value="Login!" onClick="loggin()"></td></tr>
</table>
</form>
</center>
Please anybody can help me with that?
Thank you in advance,
Emilly