Reputation: 5238
I've got a problem with the UI Dialog.
After closing the dialog and reopening it, the dialog appears twice. One dialog with the old form data (which I dont want) and a new empty dialog.
I am closing the dialog after form submit in the following way:
$('.ui-dialog-titlebar-close').click();
I have also tried closing it this way:
$(this).closest('.ui-dialog-content').dialog('close');
Have anyone experienced similar behaviour?
Upvotes: 1
Views: 3552
Reputation: 23044
While closing make sure that the dialog self-destructs..
$("#dialog").dialog({
.
.
.
close: function(){
$(this).dialog("destroy");// I also use .remove() but its redundant
}
});
Upvotes: 3
Reputation: 3626
try to put
event.preventDefault():
which can stop the behaviour like this
Upvotes: 0
Reputation: 15861
try .dialog( "destroy" )
method. Dialog.destroy
$(this).closest('.ui-dialog-content').dialog('destroy');
Upvotes: 0