File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes forcing users to close popups Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "forcing users to close popups" Watch "forcing users to close popups" New topic

forcing users to close popups

AnilPrakash Raju
Ranch Hand

Joined: Jul 26, 2004
Posts: 137
I would like users to close the popup window before entering data in the parent window.
How do you force users to do this?
Is there a parameter in the call?

Thanks in advance
Niki Nono
Ranch Hand

Joined: Mar 20, 2005
Posts: 256
use a modal dialog box for achieving this.

Life called,so here I am.<br />Cheers<br />Niki.:-)
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63866

Modal dialogs are IE-only.

I achieve this in a cross-browser manner by using a floating div that emulates a dialog.

[Asking smart questions] [About Bear] [Books by Bear]
Marc Luzietti
Ranch Hand

Joined: Feb 02, 2006
Posts: 84
Most modal scripts rely on checking the browser every second to make sure the window is on top. Not a particularly friendly thing to do. You could write a script so that onBlur the window is refocused, but there are ways around that too.

The IE modal property, in addition to being IE only, has problems passing data back to the originating window.

The best method is to either use a hidden div that becomes visible or to use an AJAX call.
[ March 01, 2006: Message edited by: Marc Luzietti ]

Support Kathy Sierra
I agree. Here's the link:
subject: forcing users to close popups
It's not a secret anymore!