I need help with this Javascript, put focus on one of the windows

Discussion in 'JavaScript' started by VarunishGarg, Apr 17, 2012.

  1. #1
    Hi Friends,

    I am using the following code.
    There is form, with two values, when the form is submitted successfully. It opens another window in fullscreen parameter, and changes the URL of the current window.
    After the new fullscreen window loads, and the URL of the current window is changed, the focus remains on the primary window (from where the form was submitted).
    I need to set focus to the current window (the one that loads).

    How do I do it ?
    Also, if by any script, if we can close the primary window (as it is no longer needed) that would be even better.

    Can some one help me.

    Thanks.
    Varunish

    ----------------------------------------------
    Code Used Below
    ----------------------------------------------
    <TABLE>

    <TR><TD><font face="verdana,arial" size=-1>Input1:</TD>
    <TD><input type="text" name="login"></TD></tr>


    <TR><TD><font face="verdana,arial" size=-1>Input2:</td>
    <TD><input type="password" name="password"></TD></TR>


    <TR><TD><font face="verdana,arial" size=-1>&nbsp;</td>
    <TD><Font face="verdana,arial" size=-1><input type="submit" value="Enter" onClick="regular()"></TD></TR>


    </TABLE></Center>
    </FORM>

    <SCRIPT LANGUAGE="JavaScript">

    function regular()
    {
    window.location.href= 'Http://www.google.com';
    window.open('Desire.html','this','toolbar=no,status=no,scrollbars=yes,location=no,menubar=no,directories=no,top=10,left=10,width=1320,height=680');
    }
    </SCRIPT>
     
    VarunishGarg, Apr 17, 2012 IP