Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8865363
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T16:29:15+00:00 2026-06-14T16:29:15+00:00

how to destroy jquery dialog when pressing escape? Is there a way to add

  • 0

how to destroy jquery dialog when pressing escape?

Is there a way to add a code like that:
$.dialog(‘destroy’);

inside of a close event?
Here is the close event: It seens that the last ‘else’ has a hide method and this is the guy. But can´t destroy anything there:

close: function( event ) {
    var that = this,
        maxZ, thisZ;

    if ( !this._isOpen ) {
        return;
    }

    if ( false === this._trigger( "beforeClose", event ) ) {
        return;
    }

    this._isOpen = false;

    if ( this.overlay ) {
        this.overlay.destroy();
    }

    if ( this.options.hide ) {
        this._hide( this.uiDialog, this.options.hide, function() {
            that._trigger( "close", event );                
        });
    } else {
        this.uiDialog.hide();
        this._trigger( "close", event );
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T16:29:17+00:00Added an answer on June 14, 2026 at 4:29 pm

    Found a way of doing this editing directly the close event since I want this behavior in the whole application.

    From:

    else {
        this.uiDialog.hide();
        this._trigger( "close", event );
    }
    

    To:

    else {
        this.uiDialog.remove();
        this._trigger( "close", event );
    }
    

    thanks a lot!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im using JQuery dialog and open an iframe inside it in the following way
I have a textarea element inside of a jquery modal dialog that has an
I'm trying to create jquery dialog, but there is no use :( here is
Is there anyone who knows how to destroy a javascript (jquery) function? I'm using
I have a dialog that displays a form. When they save or close the
I am having a problem with a form that is inside of a jquery
Below is my jQuery code : <meta charset=utf-8> <title>jQuery UI Dialog - Modal confirmation</title>
I'm trying to add a jQuery UI modal dialog to show when a function
I'm using the following JQuery block in my DotNetNuke module: jquery(document).ready(function (){ $( #dialog:ui-dialog).dialog(destroy);
I know the correct way to manage JQuery.dialog is to initialize with: $(#dialog).dialog({ autoOpen:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.