closing a child window on logout

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • backups2007
    New Member
    • Jul 2007
    • 92

    closing a child window on logout

    Let's say a user logs in to the system. He opens pop-up forms and then logs out.

    Is there a way to automatically close all child windows(pop-up windows) when a user clicks the logout button?

    I need an answer as soon as possible. Thank you.
  • Atli
    Recognized Expert Expert
    • Nov 2006
    • 5062

    #2
    Hi. Welcome to The Scripts.

    I'm pretty sure this is not possible. But if it is, it would be some kind of JavaScript.
    So, I'm going to move your question over there, where the JavaScript experts should find it.

    Comment

    • acoder
      Recognized Expert MVP
      • Nov 2006
      • 16032

      #3
      Originally posted by backups2007
      Let's say a user logs in to the system. He opens pop-up forms and then logs out.

      Is there a way to automatically close all child windows(pop-up windows) when a user clicks the logout button?

      I need an answer as soon as possible. Thank you.
      Post your code.

      If you kept a reference to the windows created, you can close them using the close() method.

      Comment

      • backups2007
        New Member
        • Jul 2007
        • 92

        #4
        How do I make a reference to other windows?

        Comment

        • dmjpro
          Top Contributor
          • Jan 2007
          • 2476

          #5
          Originally posted by backups2007
          How do I make a reference to other windows?
          [code=javascript]
          function open_children()
          {
          var win1 = window.open(... .);
          var win2 = window.opne(... .);
          .
          .
          }
          function log_out()
          {
          win1.close();
          win2.close();
          .
          .
          }
          [/code]

          Remember one thing the second parameter in window.open must be different for different windows.

          Kind regards,
          Dmjpro.

          Comment

          • FullyH3ktik
            New Member
            • Sep 2007
            • 52

            #6
            you just use the onclick event, and the names of the windows:
            [HTML]<input type="button" value="Log Out" onclick="win1.c lose();win2.clo se();etc" />[/HTML]
            Last edited by FullyH3ktik; Oct 3 '07, 04:14 AM. Reason: Added code tags

            Comment

            Working...