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:
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?
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>"