When I click on delete link it directly deletes it. I am making Jquery UI dialog box to prompt Y/N. It should prompt Yes/No. If yes- deleted or No -Original State.
Here is My PHP Code for that:
echo "<td><a name='delete' href='product_listing_delete.php?id=" . $row['id'] . "' onclick='call()' >Delete</a></td><tr>";
Here is my javascript code for that:
<script>
function call() {
$('<div></div>').appendTo('body')
.html('<div><h6>Yes or No?</h6></div>')
.dialog({
modal: true, title: 'message', zIndex: 10000, autoOpen: true,
width: 'auto', resizable: false,
buttons: {
Yes: function () {
doFunctionForYes();
$(this).dialog("close");
},
No: function () {
doFunctionForNo();
$(this).dialog("close");
}
},
close: function (event, ui) {
$(this).remove();
}
});
}
function doFunctionForYes() {
alert("Yes");
$('#msg').show();
}
function doFunctionForNo() {
alert("No");
$('#msg').show();
}
</script>