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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • harman.sidhuz
    New Member
    • Aug 2006
    • 1

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

    Hi

    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 showModelessDia log() is not useful in my project. Can we pass any argument in window.open() method so the purpose can be solve.

    Regards,
    Harman
  • iam_clint
    Recognized Expert Top Contributor
    • Jul 2006
    • 1207

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

    Comment

    • goingpostal
      New Member
      • Aug 2006
      • 3

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

      Comment

      • shivarules
        New Member
        • Jan 2008
        • 2

        #4
        Hi

        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
        [CODE=javascript]<script>
        var popupWindow=nul l;
        function popup(){
        popupWindow = window.open('ch ild_page.html', bla bla bla);
        }

        function parent_disable( ) {
        if(popupWindow && !popupWindow.cl osed)
        popupWindow.foc us();
        }
        </script>
        [/CODE]
        now in the html
        [HTML]<body onclick="parent _disable();">

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

        </body>
        [/HTML]
        Happyzzzzzzzzee ee Ending........
        Cheezzzzzzzzz
        Last edited by acoder; Feb 1 '08, 10:14 AM. Reason: Added code tags

        Comment

        • acoder
          Recognized Expert MVP
          • Nov 2006
          • 16032

          #5
          Welcome to TSDN!

          You may want to use onfocus instead of onclick.

          Comment

          • shivarules
            New Member
            • Jan 2008
            • 2

            #6
            u can use both dude.....

            cheezzzz.......

            Comment

            • acoder
              Recognized Expert MVP
              • Nov 2006
              • 16032

              #7
              You can, but you could have focus without clicking and use the keys to navigate.

              Comment

              Working...