how to disable window (X) close button using javascript

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • preetksaini
    New Member
    • Mar 2007
    • 19

    how to disable window (X) close button using javascript

    hi,
    i want to know that how can i disable the close (x) button of pop window,using javascript.

    thanx.
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    When you use window.open, you can set titlebar to no or 0, but it is usually ignored, see link.

    The alternative is to create a draggable div instead of a popup.

    Comment

    • preetksaini
      New Member
      • Mar 2007
      • 19

      #3
      thanx acoder.

      Comment

      • SamsonJohn
        New Member
        • Jul 2007
        • 5

        #4
        Hey Can You Help me out
        I have used window.showModa lDialog()
        to popoup
        Now i want to diable the close button
        is it possible
        can anyone help me out

        Comment

        • acoder
          Recognized Expert MVP
          • Nov 2006
          • 16032

          #5
          Originally posted by SamsonJohn
          Hey Can You Help me out
          I have used window.showModa lDialog()
          to popoup
          Now i want to diable the close button
          is it possible
          can anyone help me out
          Welcome to TSDN!

          Do not use showModalDialog - it is only supported by IE.

          There's no option to disable the close button, see the documentation.

          If you want this functionality, create your own draggable DHTML pseudo-popup.

          Comment

          • gits
            Recognized Expert Moderator Expert
            • May 2007
            • 5390

            #6
            hi ...

            in case you want to call a javascript function before closing the window you may use the 'onbeforeunload '-event ... normally i think this is the typical reason to want to have the close-button disabled ... so you may capture the closing of the window and may do something you want in that case ...

            kind regards

            Comment

            • SamsonJohn
              New Member
              • Jul 2007
              • 5

              #7
              Originally posted by gits
              hi ...

              in case you want to call a javascript function before closing the window you may use the 'onbeforeunload '-event ... normally i think this is the typical reason to want to have the close-button disabled ... so you may capture the closing of the window and may do something you want in that case ...

              kind regards
              hi
              Thanks for the reply
              Well have you gone through google calender
              When you click On theEvent a popup box APPEARS WITH TAIL POINTING TO PARENT WINDOW
              is it possible to create such popup window using javascript
              can u give some solution for this

              Comment

              • gits
                Recognized Expert Moderator Expert
                • May 2007
                • 5390

                #8
                Originally posted by SamsonJohn
                hi
                Thanks for the reply
                Well have you gone through google calender
                When you click On theEvent a popup box APPEARS WITH TAIL POINTING TO PARENT WINDOW
                is it possible to create such popup window using javascript
                can u give some solution for this
                hi ...

                there's a new thread with this question from you moved here from another forum, so i'll put the link to it here:



                it's better to use the new thread there for your question.

                kind regards

                Comment

                • rajeshswain
                  New Member
                  • Sep 2007
                  • 1

                  #9
                  hi,
                  i want to know that how can i disable the close (x) button of pop window,using javascript.I have set titlebar to no . But it's still not workiing.

                  can someone help me out please...

                  thanx

                  Comment

                  • gits
                    Recognized Expert Moderator Expert
                    • May 2007
                    • 5390

                    #10
                    hi ...

                    welcome to TSDN ...

                    have a look at post #6 ... the answer is up there ;) ... you cannot disable that button, but you may resspond to the event when it is clicked.

                    kind regards

                    Comment

                    Working...