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 9180405
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T18:02:45+00:00 2026-06-17T18:02:45+00:00

I have a jQuery Dialog, When you click in a image the dialogs open

  • 0

I have a jQuery Dialog, When you click in a image the dialogs open and you must be confirm if you want to delete. Yes or No.

I do this with three files:

The main file index.php:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Aircrafts</title>
    <link rel="stylesheet" type="text/css" href="../../../lib/css/style.css">
    <link rel="stylesheet" href="../../../lib/css/flick/jquery.ui.all.css">
    <script src="../../../lib/js/jquery.js"></script>
    <script src="../../../lib/js/ui/jquery.ui.button.js"></script>
    <script src="../../../lib/js/ui/jquery.ui.core.js"></script>
    <script src="../../../lib/js/ui/jquery.ui.widget.js"></script>
    <script src="../../../lib/js/ui/jquery.ui.mouse.js"></script>
    <script src="../../../lib/js/ui/jquery.ui.button.js"></script>
    <script src="../../../lib/js/ui/jquery.ui.draggable.js"></script>
    <script src="../../../lib/js/ui/jquery.ui.position.js"></script>
    <script src="../../../lib/js/ui/jquery.ui.resizable.js"></script>
    <script src="../../../lib/js/ui/jquery.ui.dialog.js"></script>


<script>
$(function() {
    $( "#loadingdialog" ).dialog({
        autoOpen: false,
        width: 300,
        height: 65
    });

    $("#loadingdialog").dialog('widget').find(".ui-dialog-titlebar").hide();
    $("#loadingdialog").dialog('widget').find(".ui-resizable-se").hide();


    $( "#confirmdialog" ).dialog({
        autoOpen: false
    });

    $("#confirmdialog").dialog('widget').find(".ui-resizable-se").hide();


});

    if (window.XMLHttpRequest)
            {
            ajax=new XMLHttpRequest();
            }
        else
            {
            ajax=new ActiveXObject("Microsoft.XMLHTTP");
            }

    function confirmdelete(str){

    var loading = $("#loadingdialog").dialog('open');
    var confirm = $("#confirmdialog");
        confirm.load("./confirm_dialog.php?icao="+str, function(){
        loading.dialog('close');
        confirm.dialog('open');
        $('#yes').blur();
        });
    }

    function remove(str){

    var loading = $("#loadingdialog").dialog('open');
        confirm.load("./delete_aircarft.php?icao="+str, function(){
        refreshTable(function(){loading.dialog('close');});
        refreshTable(function(){$('#result').fadeIn(); document.getElementById('result').innerHTML=ajax.responseText;});
        setTimeout(function() { $('#result').fadeOut() }, 5000);

        });
    }

    function close(){

    $("#confirmdialog").dialog('close');

    }
</script>
</head>
<body>

<div id="result"></div></br>

<div id="loadingdialog"><center><p><img src="../../../lib/images/loading.gif"></center></p></div>

<div id="confirmdialog"></div>

<img src="../../../lib/images/cross.png" onclick="confirmdelete('B737')">

</body>
</html>

The confirm_dialog.php:

<script>
    $("#yes")
        .button()
        .click(function(event) {
    });

    $("#no")
        .button()
        .click(function(event) {
    });
</script>

<h2><font face="century Gothic">Are you sure?</font><h2><hr size="1">

&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
<tr><td><input id="yes" type="submit" value="Yes" onclick="remove('<?php echo $_GET["icao"]; ?>')"></td>&nbsp&nbsp&nbsp<td><input id="no" type="submit" value="No" onclick="close()"/></td></tr>

And the delete_aircraft.php (At the moment this file only shows the ICAO that obtain, in the future I´m going to prepare it for delete, but It isn´t a problem):

<?php echo $_GET["icao"]; ?>

The problem is when the dialog opens, you can click Yes or No, but If you click Yes or No there isn´t any action.

  • 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-17T18:02:47+00:00Added an answer on June 17, 2026 at 6:02 pm

    Why not use the Dialog’s built-in buttons?

    $( "#confirmdialog" ).dialog({
      autoOpen: false,
      buttons: {
        "Yes": function() {
          // YOUR ACTION HERE //
          $( this ).dialog( "close" );
        },
        "No": function() {
          $( this ).dialog( "close" );
        }
      }
    });
    

    EDIT: Update your remove function to load the dialog with the buttons and the required variable: no need to load an external PHP file. Also, set the animation when you create the dialog – no need for all these extra handlers.

    $( "#confirmdialog" ).dialog({
      autoOpen: false,
      show: "fade",  // Fade In
      hide: "fade"   // Fade Out
    });
    
    
    function remove(str){
    
      // Set the button action.  str is available here
      $( "#confirmdialog" ).dialog("option", "buttons", {
        "Yes": function() {
          // YOUR ACTION HERE //
          // str has the value of your "icao" variable
          $( this ).dialog( "close" );
        },
        "No": function() {
          $( this ).dialog( "close" );
        }
      });
    
      // Open the dialog
      $( "#confirmdialog" ).dialog("open");
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a JQuery UI modal: $('#avatar-manager').click(function () { $('#dialog').dialog('open'); return false; }); $('#dialog').dialog({
I have a modal dialog plugin written in jquery, that binds to the click
I have jquery ui dialog box, and I want to resize it by the
I have a div with a link and on click should open a jQuery
I have an weird problem then i try to open an Jquery UI Dialog,
I have JQuery UI Dialog opening on pressing CTRL + Q using the following
I have a jQuery dialog which loads an external php page. All is working
I have a jquery dialog as follows - <div data-role=dialog id=msg-popup> <div data-role=header> <h1>Notification</h1>
I have a jQuery dialog that appears and loads an external page. In that
I have a jQuery dialog form: $loading.dialog({ closeOnEscape: false, resizable: false, draggable: false, width:

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.