Chants - Debt Consolidation - Skype - Just Holden Commodores - Electric blanket

PDA

View Full Version : small login script


metalbuckle
Oct 18th 2007, 3:26 pm
i'm trying this - not working.. small login script - enter the password and a popup window opens.. everything seems to fine - but the popup is not opening...

<script language = "javascript">
function Login1()
{
var ftext = document.login.ftext.value;

if(ftext == 'enter')
function popup_window() {
window.open('test.htm', 'popup', 'width=500, height=660, menubar=no, scrollbars=yes, toolbar=no, location=no, resizable=yes, top=, left=');
}
else
{
alert("incorrect password");
}
}

</script>

<FORM NAME="login" onSubmit="return Login1()">
login: <INPUT TYPE=TEXT NAME=ftext><BR>
<INPUT TYPE=submit VALUE="Done">
</FORM>

KatieK
Oct 18th 2007, 4:26 pm
I think this might be your problem:



if(ftext == 'enter')
function popup_window() {
window.open('test.htm', 'popup', 'width=500, height=660, menubar=no, scrollbars=yes, toolbar=no, location=no, resizable=yes, top=, left=');
}
else
{
alert("incorrect password");
}
}



What you're doing is declaring the popup_window function, but you're not calling it. Try moving the whole popup_window function declaration outside of the Login1 function, and then just put "popup_window()" inside your if clause.