Reputation: 11
I have been trying to do the follow:
I am trying the following code:
$('#RegisterDialog').dialog({
autoOpen: false,
closeOnEscape: false,
position: 'center',
modal: true,
width: 600,
buttons: {
"Cancel account registration": function() {
$(this).dialog("close");
window.location = 'http://localhost/';
}
}
});
$(".Register").click(function() {
$('#RegisterDialog').dialog("close");
$('#RegisterDialog').hide();
});
However, it hides and pops back up again. I also tried 'autoClose: false'.
Any help please?
Upvotes: 0
Views: 2382
Reputation: 11
You should try .remove()
.
This will remove the element and it won't pop up again.
Upvotes: 1
Reputation: 5112
I think you should do like this
$(".Register").click(function() {
$('#RegisterDialog').dialog("close");
//$('#RegisterDialog').hide(); --> no need to call this
});
Upvotes: 0
Reputation: 3318
From the jQuery documentation...
.dialog( "destroy" )
// Remove the dialog functionality completely. This will return the element back to its pre-init state.
This might do the trick.
Upvotes: 0