Forum Moderators: open

Message Too Old, No Replies

Disable main window

Disable main window when popup is open

         

Majid

6:35 pm on Apr 12, 2009 (gmt 0)

10+ Year Member



Hello,

I'm writing a small accounting program for myself with PHP and web base .

in many sections I opened a popup window, now I want to disable the parent window when a popup window is enable .

how can I do this?

rocknbil

8:07 pm on Apr 12, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Essentially, you can't, although there are many methods to do something that has this effect, it's a bad idea on so many levels I don't know where to start.

If you insist, look into the Javascript methods of focus(); basically if your pop-up is open and they return to the main window, you force focus to the pop up.

punisa

11:33 am on Apr 30, 2009 (gmt 0)

10+ Year Member



Hmm, this is something I never saw actually. You said you were building it for yourself? I guess you mean for your internal employees?

Why do you actually need to "disable" the parent window?
You want to prevent them clicking on the main window or?
Do you just need to force the pop up window in focus?

If you can provide a little bit more info, maybe we can think of something :)

g1smd

10:22 pm on Apr 30, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Disabling the parent window is a very bad idea.

Don't mess with the users UI unless you want users to hate the app.

brodyh

1:04 am on May 11, 2009 (gmt 0)

10+ Year Member



Opening a new window will generally make your users very annoyed with you.

But, like @rocknbil said, there are methods that have the effect. You could redirect the user to another page or a blank page (about:blank) after clicking on your link. Try this:

<a href="about:blank" onClick="**insert your JavaScript window-opening code here**">Start the App!</a>

...but still, why not just load the app in the current window? The only issue I can see is wanting to disable the back/forward buttons but technically savvy users can still do this using key commands. If this is the case re-write your code so there would be no issue if users *did* do this. Another solution to this is invoking IE by command line to disable the toolbars. As much as I hate IE, if you must use it, then this is an option.

Well, I've rambled too long. Hope I've helped.