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
  1. #1
    New to the CF scene
    Join Date
    Nov 2008
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Closing browser on click on button from modaldialogbox window

    Hi Experts,

    I am using with JSP & java code. When i click on "Save" button in jsp, then it shows ModalDialogBox window to confirm. I get input from user & then if user clicks on "Yes", i want to close both the modaldialogbox window & parent browser window.
    But i am able to only close the ModalDialog window not parent window.
    I have tried all the solutions.
    please help me out.

    the code which i m using is given below....

    function closeWindow()
    {
    //alert("hi");
    //window.opener = self;
    //window.close();
    //this.getTopForm(0).window.close();
    //self.window.close();
    //self.close();
    var top = window.open("", "_top");
    top.close();
    }


    var top = window.open("", "_top");
    top.close();
    this is working fine but giving a prompt box. I dnt want this box. I need if user click on Yes button on modaldialogbox window, everything should be closed.

    Your suggestions would be appriaciated

  • #2
    Senior Coder rangana's Avatar
    Join Date
    Feb 2008
    Location
    Cebu City, Philippines
    Posts
    1,752
    Thanks
    65
    Thanked 372 Times in 365 Posts
    You can use window.close(), but that would only work on IE, not unless you've opened the window via script (window.open()).

    For further reading:
    https://developer.mozilla.org/En/DOM:window.close
    Learn how to javascript at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph


  •  

    Posting Permissions

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