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

  • Home
  • SEARCH
  • 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 8385619
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T17:43:04+00:00 2026-06-09T17:43:04+00:00

I have a data table setup (http://datatables.net/) and I am trying to have an

  • 0

I have a data table setup (http://datatables.net/) and I am trying to have an option to delete a row from the table and have a jQuery dialog modal popup to confirm. However, the modal works fine on the first page of the table, but when the table goes to the 2nd page, the modal stops working. My guess is when the table paginates to the next 10 entries, something happens that removes the dialog click call.

Here is my code for the modal:

    $('#delete-dialog').dialog({
        autoOpen: false, 
        width: 400,
        modal: true
    });

    $('.delete_modal').click(function (e) {
        e.preventDefault();
        var targetUrl = $(this).attr("href");
        $('#delete-dialog').dialog({
          buttons: {
            "Delete": function() {
              window.location.href = targetUrl;
            },
            "Cancel": function() {
              $(this).dialog("close");
            }
          }
        });
        $('#delete-dialog').dialog("open");
    });

and here is my code for the modal:

<div id="delete-dialog" title="Remove User">
    <p>Are you sure you want to delete this user?</p>
</div>

Any idea why it works on the first page of the table, but not the 2nd?

Here is my delete code:

<li><a href="?page=users&sub=admins&action=delete&id=<?=$row['id']?>" class="delete_modal"><span class="icos-trash"></span>Delete</a></li>
  • 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-09T17:43:05+00:00Added an answer on June 9, 2026 at 5:43 pm

    My guess is that you’re loading new elements that have not been bound with jquery. You could bind the new elements or attach a handler to you .delete_modal class like so.

    $("body").on("click", ".delete_modal", function (e) {
    e.preventDefault();
            var targetUrl = $(this).attr("href");
            $('#delete-dialog').dialog({
              buttons: {
                "Delete": function() {
                  window.location.href = targetUrl;
                },
                "Cancel": function() {
                  $(this).dialog("close");
                }
              }
            });
            $('#delete-dialog').dialog("open");
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the data table from the jquery plugin dataTables (http://datatables.net/) that I want
I am using Datatables Collapsible/Expandable Grouping. http://jquery-datatables-row-grouping.googlecode.com/svn/trunk/collapsibleGroups.html I have configured it so that all
I have a data table filled with text in each table row. How do
Using this example: http://www.w3schools.com/php/php_ajax_database.asp I have set up a table echoing from database. I
So I have been trying to get a ListView to display data from a
I have set up 2 two tables - table userid and table data in
I have two tables set up in phpmyadmin- table userid and table data. The
I have data table containing one column as FilePath. FilePath D:\New folder\link.txt D:\New folder\SharepointMigration(Work
I have a data.table object like this one library(data.table) a <- structure(list(PERMNO = c(10006L,
I have a data table with many rows and columns. How can I display

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.