Results 1 to 4 of 4

Thread: How to disable Javascript parent onclick?

  1. #1
    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!

  2. #2
    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

  3. #3
    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">

  4. #4
    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.

Similar Threads

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

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,750,615,940.35648 seconds with 16 queries