Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: naming a window

  1. #1
    New Coder
    Join Date
    Jun 2002
    Posts
    58
    Thanks
    0
    Thanked 0 Times in 0 Posts

    naming a window

    Hi,

    I have this javascript code that pops up a new window when pressed. How do I name this window "Login". Here is the code:

    <form method="post" action="http://www.mysite/cgi/login.cgi" target="popupWin" onSubmit="javascript:
    var w = 140;
    var h = 147;
    var winFeatures = 'width='+w+',height='+h+',location=yes,scrollable,left=350,top=220,resizable=yes';
    var winPtr = window.open('', this.target, winFeatures);
    return true;">



    Thanks

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Posts
    344
    Thanks
    0
    Thanked 0 Times in 0 Posts
    First of all, re-do your code...

    here's what I suggest...

    Code:
    <html>
    <head>
    <title>test</title>
    <script language="JavaScript">
    <!--
    function openWindow()
    {
    var w = 140; 
    var h = 147; 
    var winFeatures = 'width='+w+',height='+h+',location=yes,scrollbars=yes,
    left=350,top=220,resizable=yes'; 
    var winPtr = window.open(this.target, 'Login', winFeatures); 
    //-->
    </script>
    </head>
    <body>
    <form method="post" action="http://www.mysite/cgi/login.cgi" target="popupWin" onSubmit="openWindow(); return true;">
    </form>
    </body>
    </html>
    Try that, see if it works - that's how you name a window..

    Here is the javascript openwindow function explained.

    Variable = window.Open('PAGE_URL', 'PAGE_NAME', 'PAGE_PROPERTIES');

    That's it

    ~Quack


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •