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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T17:35:55+00:00 2026-06-07T17:35:55+00:00

Need some help on this. I am clicking on a delete image which is

  • 0

Need some help on this. I am clicking on a delete image which is present in one of the cell of one of the row. Once I click the delete image there should be a modal confirmation box asking user to confirm the row delete. Well, the functionality is working but the modal confirmation box does not show up on first click on delete image – but shows up on second click. I wrote console.log when image gets clicked – it logs every time that images is clicked – But the confirmation box does not show up first time. Without the confirmation box logic, if I click on delete image the row gets deleted on first click only.

Here is the code:

$('#example.display tbody tr td img#delete').live('click', function(){
  console.log("Delete clicked");

  var oTable = $('#example').dataTable();
  var nRow = $(this).closest("tr").get(0);
  var aData = oTable.fnGetData(nRow);

  ("#DeleteConfirmationModalWindow").html('<h6>'+'Are you sure you wish to delete order:'+'<br />'+aData[0]+'?'+'</h6>');
  $("#DeleteConfirmationModalWindow").dialog('open');

  $("#DeleteConfirmationModalWindow").dialog({
      title: "Delete Confirmation",
      autoOpen: false,
      dialogClass: "DeleteConfirmationModalWindow",
      closeOnEscape: false,
      draggable: false,
      width: 400,
      height: 200,
      modal: true,
      buttons: {
            "Yes, I'm sure": function() {
                $( this ).dialog( "close" );
                console.log("Delete");
                deleteDatabaseRow(oTable, nRow);    
                oTable.fnDeleteRow(nRow);
            },
            Cancel: function() {
                $( this ).dialog( "close" );
                console.log("No delete");
            }
        },
    resizable: false,
    open: function() {
              $('body').css('overflow','hidden');
          },
    close: function() {
              $('body').css('overflow','auto');
          }
    });                     
});

Please help! Thanks!

  • 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-07T17:35:58+00:00Added an answer on June 7, 2026 at 5:35 pm

    There is a mistake in your code. Your are calling $("#DeleteConfirmationModalWindow").dialog('open'); before creating your dialog.

    First, remove $("#DeleteConfirmationModalWindow").dialog('open'); and your option autoOpen: false and let me know if it works or not.

    .live is deprecated if you are using jQuery 1.4+ see Here. Simply use .click instead.

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

Sidebar

Related Questions

We Really need some help on this one: We've Struggled with all the Apple
I need some help. I have a div inside which there are some radio
I need some help formulating this query. I have two (relevant) tables, which I
Need some help with this problem in implementing with XSLT, I had already implemented
I need some help understanding this bit of code pre { white-space: pre; white-space:
I need some help revising this. It keeps only displaying 0s as the temp.
I really need some help with this as I have been trying to fix
Im a javascript newbie and would need some help with this simple thing... I
Okay, I really need some help with this. I'm new with designing and stuff,
First of all, sorry for my English. I need some help with this. Recently

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.