Confirm delete?
Confirm delete?
Hi everyone, been trying to figure out the syntax for a confirm alert when someone clicks the "delete" button to delete rows in my table.
[code]
$('#delete_row').click( function () {
$.ajax( {
"url": "/delete_row.php",
"data": { "ids": selectedIds },
"dataType": "json",
"type": "post",
"success": function ()
[/code]
I've found a few examples of code that will do what I'm referring to, but I'm not sure how to fit them in to the above syntax. Any direction would be greatly appreciated.
-S
[code]
$('#delete_row').click( function () {
$.ajax( {
"url": "/delete_row.php",
"data": { "ids": selectedIds },
"dataType": "json",
"type": "post",
"success": function ()
[/code]
I've found a few examples of code that will do what I'm referring to, but I'm not sure how to fit them in to the above syntax. Any direction would be greatly appreciated.
-S
This discussion has been closed.
Replies
[code]
$('#delete_row').click( function () {
if ( confirm( "Are you sure you want to delete the selected rows?" ) ) {
$.ajax( {
"url": "/delete_row.php",
"data": { "ids": selectedIds },
"dataType": "json",
"type": "post",
"success": function () {...}
} );
}
} );
[/code]
Allan