I'm using jQuery Ajaxify to ajaxify my forms. It has all the same callbacks as the standard $.ajax
function. I'm trying to add in a standard Javascript confirm()
dialog before the form gets submitted though. Problem is, as soon as you click the submit button, the ajax request goes through. How do I delay that until after the user makes a choice to confirm?
The scripts that are clashing are:
$('form').ajaxify({
success: function(data, status, request) {
// do some stuff
}
})
Which just submits the form via ajax rather than the HTML way. And then this script:
$('#accept-form').submit(function(e) {
return confirm('Are you sure you want to accept this bid?');
});
Which does pop up the dialog, but it doesn't really matter what you click because the form has already been submitted and sent.