Here is the code:
$(document).ready(function () { var options = { target: "#output", beforeSubmit: showRequest, success: showResponse, timeout: 3000 }; // привязываем событие submit к форме $('#form').submit(function () { $(this).ajaxSubmit(options); return false; }); // ---- Форма ----- }); // вызов перед передачей данных function showRequest(formData, jqForm, options) { return true; } // вызов после получения ответа function showResponse(responseText, statusText) {}
Jquery and jquery.form are connected. In the handler .submit(fn)
fn returns false, as you can see, but the form is sent 2 times. How to prevent re-sending?
return false
explicitly stated in it?)) - Sh4dow