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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

set focus on popup window

Status
Not open for further replies.

gorgered

Programmer
Dec 13, 2005
24
0
0
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.confrim("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
 
Hi,

Sorry there is a typo in the function call Plz ignore that

Code:
 var flag = window.[red]confrim[/red]("This will set the status as Active");




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top