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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T18:35:13+00:00 2026-05-31T18:35:13+00:00

Here is the extract code of how to make a confim box when delete,

  • 0

Here is the extract code of how to make a confim box when delete,

For html part:
A link is to trigger JS code , but it will trigger the php code at same time

For JS part:
popupbox is triggered

For php part:
Process the sql query, it should be ok

The problem are:

  1. I should use js to trigger the php page?But how can i let the php page know that which ListID i want to delete?

  2. What should i put in the html link?

Thank you

html

<a id="delete" href='delete.php?id=$set[ListID]'>Delete</a>

Js

$(function(){
  $("#delete").click(function() {
    $.messager.alert('Warning','The warning message');  
    $.messager.confirm('Confirm','Are you sure you want to delete record?',function(r){  
        if (r){  
            alert('ok');  
        }  
    });  
 });
});

php

//connection db
INSERT  INTO delete_list SELECT * FROM list WHERE ListID=?;    
INSERT  INTO delete_user_list SELECT * FROM user_list WHERE ListID=?;    
INSERT  INTO delete_require_attributes SELECT * FROM require_attributes WHERE ListID='2';    
INSERT  INTO delete_subscriber SELECT * FROM subscriber WHERE ListID=?;    
INSERT  INTO delete_subscriber SELECT * FROM subscriber WHERE ListID=?;    
DELETE FROM list WHERE ListID = '1'

What if i want to include the list name in the popup box e.g. do you want to delete list A ,where list A is a variable already. The only thing is how can i append it to the popup box

"<tr><td>".$set['ListName']."</td><td>"
  • 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-05-31T18:35:15+00:00Added an answer on May 31, 2026 at 6:35 pm

    I don’t know what $.messager does, but I suppose this should work

    $(function(){
      $("#delete").click(function(evt) {
        evt.preventDefault();
        var urlscript = this.href;  /* read link url (e.g. delete.php?id=314159) */
    
        $.messager.alert('Warning','The warning message');  
        $.messager.confirm('Confirm','Are you sure you want to delete record?',function(r){  
            if (r) {                  
               $.ajax(urlscript); /* make ajax call to that url with the right id */    
            }  
        });  
     });
    });
    

    and I supposing that your source code is actually showing smthg like

    <a id="delete" href='delete.php?id=314159'>Delete</a>
    

    so on the ajax call you’re sending that id.

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

Sidebar

Related Questions

Here is the extract code of how to make a confim box when delete,
Have a simple form (only extract fields here) but for some reason the JQserilization
Here's the current code I am using. <? header(Content-type: image/png); // example: <img src=gradient.php?height=600&width=100&start=00FF00&end=ff0000
I'm using the following code on my iPhone app, taken from here to extract
Here is an extract from item 56 of the book C++ Gotchas: It's not
i want to extract some text in certain website. here is web address what
I'm trying to make a regex which gets the part between two other things
I don't really understand PHP and now I need to make our contact us
I modified the code published on smbrown.wordpress.com which can extract the top tracks using
Here is nice piece of code that works fair in all browsers: http://www.imaputz.com/cssStuff/bigFourVersion.html Since

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.