$('#contact').submit(function(e) { e.preventDefault(); var form = $(this); // ajax $.ajax({ type: 'POST', url: $(this).attr('ajaxgetaccommodationsbyemail'), success: function(answer) { $.dialog(function(){ // this line is "pseudocode", put the code of your dialog here. // when clicked YES form.submit(); }, function(){ // when clicked NO }); } }); });
Если вам действительно нужен настраиваемый диалог, вы можете использовать: https://jqueryui.com/dialog/#modal-confirmation