Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to make sure Popup window remains on Top? 1

Status
Not open for further replies.

gorgered

Programmer
Dec 13, 2005
24
US
Hi,

On a page I have a button onClick of the button I open a popup window and at the same time I submit the parent window. How do I make sure the popup window stays on top.

Code:
/*
  This function will check the status and opens a new popup
   1. Status == Pending
      open new popup window
      submit the parent window
   2. Status != Pending
      open new popup window
*/
function openPopUpAndSubmit(statusObj, url){
  if(statusObj.value == "Pending"){
    var flag = window.confirm("This will set the status as Active");
     if(flag){
         openWindow(url);
         var formObj = eval("window.form0");
         formObj.submit();
     }else{
         openWindow(url);
     }
  }else{
      openWindow(url);
  }
}
I tried setting the focus on popup window. It works but not always only some times I wonder why? I think if the parent window is little slow in reloading then the focus sifts back. Is there any better and concreat solution for this?

Help or Ideas are greatly appriceated.

Thanks
Gorge
 
You had asked in another thread recently. Just an opinion here---don't take it with too much faith.

If the popup is not modal, I don't think you can "absolutely" control the window to be on top from within the user agent---the os has the final say.

So maybe you should consider in that case showModalDialog for ie. And for moz, use window.open with modal="yes" included in it feature. But I'm not sure it emulate 100% ie's showmodaldialog.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top