Reputation: 1146
I would like to handle a successful call from the submit below and reload the current page. How can i best achieve this?
$('#modal-confirm').click(function() {
$(form).ajaxSubmit();
$(form).resetForm();
$('#myModal').modal('toggle');
});
Upvotes: 0
Views: 101
Reputation: 1146
$(document).ajaxSuccess(function() { // http://api.jquery.com/ajaxSuccess/
location.realod();
})
$('#modal-confirm').click(function() {
$(form).ajaxSubmit();
$(form).resetForm();
$('#myModalOne').modal('toggle');
});
Upvotes: 0
Reputation: 8389
You can perhaps try this out..
$('#modal-confirm').on("click", function(e){
e.preventDefault();
$.ajax({
url : '...'
}).done(function(data) {
//handle your conditions here once the request is successful. if conditions are met, then...
location.reload(true);
});
});
Upvotes: 0
Reputation: 44740
You can pass option to ajaxSubmit()
$(form).ajaxSubmit({
success:function(){
alert("complete");
// do other stuff
}
});
Upvotes: 1