View Full Version : Closing browser on click on button from modaldialogbox window

11-20-2008, 09:57 AM
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()
//window.opener = self;
var top = window.open("", "_top");

var top = window.open("", "_top");
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

11-20-2008, 12:37 PM
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: