Answer the question
In order to leave comments, you need to log in
Why doesn't beforeSend work, the button doesn't turn off and emails are sent more than once (how many times you can click)?
<script>
$('#modal_form1').submit(function(){
var form = $(this);
var data = form.serialize();
$.ajax({
type: "POST",
url: "mailer/smart3.php",
data: data,
beforeSend: function() {
form.find('input[type="submit"]').attr('disabled', 'disabled');
}
}).done(function() {
form.find("input").val("");
$('#callModal1').modal('hide');
window.location = "https://12345";
$("#modal_form1").trigger("reset");
});
return false;
});
</script>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question