469,266 Members | 1,679 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,266 developers. It's quick & easy.

How we can disable parent window while popup window is open?


How we can disable parent window while popup window is open? i am using window.open() method to open new popup window. As per my requirement, showModalDialog() or showModelessDialog() is not useful in my project. Can we pass any argument in window.open() method so the purpose can be solve.

Aug 8 '06 #1
6 49170
1,208 Expert 1GB
I would say no not with javascript. what do you mean disable? you can put your whole parent page in a span or div and hide the innerhtml?
Aug 8 '06 #2
Code an event listener that will handle some action like ignoring events generated by the parent window. See Quiksmode's Advanced Event Registration topic here: http://www.quirksmode.org/js/events_advanced.html.
Aug 8 '06 #3

I hope by this time u might hv got the answer but it may help others,
here is the code

in the javascript write this function
Expand|Select|Wrap|Line Numbers
  1. <script>
  2. var popupWindow=null;
  3. function popup(){
  4. popupWindow = window.open('child_page.html', bla bla bla);
  5. }
  7. function parent_disable() {
  8. if(popupWindow && !popupWindow.closed)
  9. popupWindow.focus();
  10. }
  11. </script>
now in the html
[HTML]<body onclick="parent_disable();">

<input type="button" onClick="return popup();" />

Happyzzzzzzzzeeee Ending........
Jan 31 '08 #4
16,027 Expert Mod 8TB
Welcome to TSDN!

You may want to use onfocus instead of onclick.
Feb 1 '08 #5
u can use both dude.....

Feb 1 '08 #6
16,027 Expert Mod 8TB
You can, but you could have focus without clicking and use the keys to navigate.
Feb 1 '08 #7

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

5 posts views Thread by Peter | last post: by
2 posts views Thread by epaetz | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.