In the dialog form below, I have 2 buttons: Save & Cancel. When user double-click save button, my data is posted 2 times. How can I avoid it?
$(this).dialog({
modal: true,
resizable: false,
title: "Edit",
close: function () { $(this).dialog('destroy').remove(); },
buttons: {
"Save": function () {
// Manually submit the form
var form = $('form', this);
$(form).submit();
},
"Cancel": function () { $(this).dialog('destroy').remove(); }
}
});
Thanks.
This is an old problem. One thing that you could do is