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

new window stay on top

Status
Not open for further replies.

malonep

Programmer
Jul 14, 2004
44
CA
Hi,

I have a page that on submit button press redirects to the submit page.

When the submit page is done it sets the page back to the page that called the submit and opens a new window.

The new window is opening first and when the first window reloads (takes longer) it ends up on top.

Is there a way to make the new window stay on top

page one (infoEnter.asp)
window.document.form1.action = "submit.asp?count="+ Counter + "&printable=yes&" + QS;
window.document.form1.submit();

page two (submit.asp)

<%if Request.QueryString("printable") = "yes" then%>
<script language="javascript">
window.document.location.href="infoEnter.asp?<%=Request.QueryString%>";
parent.window.open("Printable.asp?<%Request.QueryString%>" , "PrintInfo","top=50,left=50,width=550,height=300");
</script>
 
In printable.asp, you can put this in the body statement:

onblur="window.focus()"

and that will keep the window on top until it's closed.

Lee
 
Nah, it won't work if there are any form field on the page.

When a form field gets focus, the window loses focus. This would cause a headache for anyone trying to fill in a field in the popup window - they'd never be able to.

There is no true way to force focus on a window, unless you use a modal window, which is only available in crappy IE.

*cLFlaVA
----------------------------
Lois: "Peter, you're drunk!"
Peter: "I'm not drunk, I'm just exhausted from stayin' up all night drinking!
 
The popup was supposed to be a printable copy of the order, I thought. There wouldn't be any forms in that, except for a button to close the window.
 
Sounds good. Test it, though, I can still get the window to easily lose focus.

*cLFlaVA
----------------------------
Lois: "Peter, you're drunk!"
Peter: "I'm not drunk, I'm just exhausted from stayin' up all night drinking!
 
Hi

I would pop up a window that 'previews' the page they want to print then have a print button that calls a page that onload prints and closes itself, you then remove the need to keep the focus on that window...

link - > preview win - > printwin and self close

just a thought.

Thanks

Glen



Glen
Conception | Execution
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top