Hi ,
I am trying to implement a custom modal dialogue implementation for Mozilla browser which will act same as showModalDialog of IE.
For achieving the modalDialog functionality i have written a JS function checkFocus() which will be called “onFocus” of the invoking[parent] window.
–> [U]Opening modalwindow
modalWin=window.open(url,”modalDialog”,””);
–> [U]Function using for making the opened modalWin as modalDialog
function checkFocus()
{
//modalWin is the reference object of window opened that will act as
modalDialog
if (modalWin!=null && !modalWin.closed)
{
self.blur();
modalWin.focus();
}
}
–> [U]Calling the function
the above function will be invoked as <body onFocus=”checkFocus();”> from the parent page in which the modalWin has been opened.
It works fine for the normal flow. But if i opened multiple windows of mozilla and one of the windows has my application which invokes the modalDialog, once after the modal dialog is opened if i clicked the parent window, the focus shifts to any other window beside the parent window and modalDialog window.
this is because of self.blur() that i am using in my guess. But the same code is working fine for Safari browser. So i am a bit confused.
Any ideas to resolve the above problem will be appreciated.
Thanks,
kiran