why does not open the dialog box "delete-dialog2" when running the line in bold
Code:
<script type="text/javascript">
$(function () {
var deleteLinkObj;
// delete Link
$('.delete-link').click(function () {
deleteLinkObj = $(this); //for future use
$('#delete-dialog').dialog('open');
return false; // prevents the default behaviour
});
//definition of the delete dialog.
$('#delete-dialog').dialog({
autoOpen: false, width: 350, resizable: false, modal: true, //Dialog options
buttons: {
"Confirm": function () {
$.post(deleteLinkObj[0].href, function (data) { //Post to action
if (data == '@Boolean.TrueString') {
deleteLinkObj.closest("tr").hide('slow'); //Hide Row
//(optional) Display Confirmation
}
else {
**$('#delete-dialog2').dialog('open');**
}
});
$(this).dialog("close");
},
"Cancel": function () {
$(this).dialog("close");
}
}
});
$('#delete-dialog2').dialog({
autoOpen: false, width: 350, resizable: false, modal: true, //Dialog options
buttons: {
"Accept": function () {
$(this).dialog("close");
}
}
});
});
</script>
It only shows the dialog with confirm and cancel buttons, but when to show cuandro dialog with the accept button is not shown blessings
03-27-2012, 02:37 PM
DanInMA
eitehr your first condition is being met, #delete-dialog2 doesnt exist in the current document, or you are calling the function incorrectly. seeing as how .dialog() is probably from some kind of plugin, you should probably provide more information about it.