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>
I think this might be your problem: 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.