Reputation: 160
I have a problem. Each time I click in Confirmation 'Cancel', the next time needs one more click to close dialog.
$('.boton-estado').unbind().click(function () {
$('#id_estado').val($(this).val());
$("#estados").submit(function (event) {
if (!confirm("¿Realizar cambio de estado?")) {
event.preventDefault();
event.stopPropagation();
}
});
$("#estados").submit();
});
Ideas? Thx
Upvotes: 0
Views: 50
Reputation: 28523
Try this: put submit button handler outside the button handler
$(function(){
$('.boton-estado').unbind().click(function () {
$('#id_estado').val($(this).val());
$("#estados").submit();
});
$("#estados").submit(function (event) {
if (!confirm("¿Realizar cambio de estado?")) {
event.preventDefault();
event.stopPropagation();
}
});
});
Upvotes: 1