PDA

View Full Version : Help on Window.location code



dmyoungsal
04-21-2010, 11:13 PM
I have a password protected page (a portion of the code is below), that I want to open the new page in a new tab. I have googled "window.location" and tried the suggested changes with no success. So I thought I would ask for help.

Here is the code:

<!-- 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=="santa" && password=="rita") { window.location="toc.htm"; done=1; }
if (username=="bright" && password=="arrow") { window.location="batoc.htm"; done=1; }
if (username=="business" && password=="office") { window.location="botoc.htm"; done=1; }
if (username=="duncan" && password=="mckinnon") { window.location="toc.htm"; done=1; }
if (username=="new" && password=="republic") { window.location="toc.htm"; done=1; }
if (username=="build" && password=="schools") { window.location="/contransfer.htm"; done=1; }
if (done==0) { alert("Invalid login!"); }
}
// End -->