Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 19-08-2009
Member
 
Join Date: Apr 2009
Posts: 65
How to disable Javascript parent onclick?

I want to disable the parent window when I opened the child window using javascript and html, and to do that I am using window.open() method to open new popup window. As per my requirement, showModalDialog() or showModelessDialog() is not useful in my project. Does any one has any solution on this problem.

Any suggestions would be appreciated!
Reply With Quote
  #2  
Old 19-08-2009
Member
 
Join Date: Oct 2008
Posts: 68
Re: How to disable Javascript parent onclick?

You need to Attach a function to the onclick and onfocus event handlers which would do something like this, and to understand by you

javascript Syntax (Toggle Plain Text)

function focusChild()
{
if(output_window)
output_window.focus();
}

AJAX allows to write web-applications without reloading/refreshing the page on user interaction function focusChild() { if(output_window) output_window.focus(); }
Here output_window is a global variable which holds the reference to the newly created popup window. It follows that as long as the child window is alive it will the one given focus. you can put your whole parent page in a span or div and hide the innerhtml
Reply With Quote
  #3  
Old 19-08-2009
Member
 
Join Date: Mar 2008
Posts: 232
Re: How to disable Javascript parent onclick?

You can get the popup window functionalities and the script to disable parent window using this javascript . Post the updated code with code tags. Read the announcements and site rules to know about them without which getting help might be a bit difficult. Copy the following Java script code into your parent page.
<input type="button" id="hide" onclick="topWindow()" value="click">
Reply With Quote
  #4  
Old 19-08-2009
Member
 
Join Date: Mar 2008
Posts: 227
Re: How to disable Javascript parent onclick?

In my code i am disabling the parent window after opening the first child window. If you right click and download this php file, and open it in a text editor (WordPad leave the structure in place), then click on the same link to open it in a web browsersfrom first child window i am opening another(second) child window. but the focus is always in my first child window only. when i open the second child window also foucs is gng to firt child window only. you could have focus without clicking and use the keys to navigate.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How to disable Javascript parent onclick?"
Thread Thread Starter Forum Replies Last Post
using href vs. onclick to call javascript function Kalyug Software Development 6 12-05-2010 10:09 AM
How to keep rollover image onClick in javascript? MAGALY Software Development 4 08-03-2010 08:02 PM
What are parent::construct() and parent::destruct() in PHP? warehouse peon Software Development 5 06-03-2010 07:11 AM
HTML/JavaScript/onclick KADEEM Software Development 4 03-11-2009 06:37 PM
How to design javascript parent iframe Nurhan Software Development 3 13-08-2009 03:26 PM


All times are GMT +5.5. The time now is 01:10 AM.