Ok, ive created a login script and i have saved it as login.js. See below:
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function Login(){
var done=0;
var username=document.login.username.value;
username=username.toLowerCase();
var password=document.login.password.value;
password=password.toLowerCase();
if (username=="someone" && password=="something") { window.location="page.htm"; done=1; }
if (done==0) { alert("Invalid login! (try lower case)"); }
}
// End -->
</SCRIPT>
<text>
<center>
<form name=login>
<table width=225 border=1 cellpadding=3>
<tr><td colspan=2><center><font size="+2"><b>Secure Area!</b></font></center></td></tr>
<tr><td>Username:</td><td><input type=text name=username size="20"></td></tr>
<tr><td>Password:</td><td><input type=password name=password size="20"></td></tr>
<tr><td colspan=2 align=center><input type=button value="Login!" onClick="Login()"></td></tr>
</table>
</form>
</center>
</text>
I have added the following to the page on which the login script should appear:
<SCRIPT SRC="login.js" language="JavaScript/text">
</SCRIPT>
The script its self works, but it does not work from the login.js file. What am i doing wrong?
Greatful for any help you can give me,
NuGG