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 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Aug 2002
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to disable the parent window when a new popup window is opened from it

    I have a MAIN.JSP page and there is a HREF (hyper reference) on it. When a user clicks the HREF a popup window POP.JSP is opened. I used the following syntax to achieve this (this code is written in JAVA script in MAIN.JSP):
    function popup_click() {
    var page = "POP.JSP";
    windowprops = "height=150,width=300,location=no,"
    + "scrollbars=no,menubars=no,toolbars=no,resizable=no";
    window.open(page, "Popup", windowprops);
    }

    The problem is that when the pop up window is displayed I want to disable the MAIN.JSP window. Question is : How to achieve this functionality?

    Waiting for a reply from experts.

    Thank,
    LadyN.

  • #2
    New to the CF scene
    Join Date
    Aug 2002
    Location
    Slidell, Louisiana
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    What do you mean by "disable" it? Close it?

  • #3
    New to the CF scene
    Join Date
    Aug 2002
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    No, I do not want the window to be closed. By disabling I mean that the user cannot do anything on the MAIN.JSP until he closes the POP.JSP (like if you open a alert() box through JAVA script than until you don't close it you cannot do anything to the parent window ).

  • #4
    Senior Coder
    Join Date
    Aug 2002
    Location
    UK
    Posts
    2,789
    Thanks
    2
    Thanked 14 Times in 14 Posts
    Try this

    In the page loaded into the popup window add

    onBlur="self.focus()

    to the opening BODY tag

    You cannot access any windows until the popup is closed

  • #5
    New to the CF scene
    Join Date
    Aug 2002
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you very much for your advice Mr. J. The syntax works!
    But there is a slight problem in this solution that is this syntax does not allow you to select a value from the combo boxe(s) that are on the POP.JSP.

  • #6
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,280
    Thanks
    4
    Thanked 83 Times in 82 Posts
    You can use a modeless window for IE5+ users:

    http://www.dynamicdrive.com/dynamici...odelesswin.htm
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster


  •  

    Posting Permissions

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