small login script

Discussion in 'JavaScript' started by metalbuckle, Oct 18, 2007.

  1. #1
    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>
     
    metalbuckle, Oct 18, 2007 IP
  2. KatieK

    KatieK Active Member

    Messages:
    116
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    58
    #2
    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.
     
    KatieK, Oct 18, 2007 IP