$('#modal_form1').submit(function(){
var form = $(this);
var data = form.serialize();
form.find('input[type="submit"]').attr('disabled', 'disabled');
$.ajax({
type: "POST",
url: "mailer/smart3.php",
data: data
}).done(function() {
form.find("input").val("");
$('#callModal1').modal('hide');
$("#modal_form1").trigger("reset");
});
return false;
});
$('#modal_form1').submit(function(evt){
if (this.isSubmitted) {
evt.preventDefault();
return false;
}
this.isSubmitted = true;
var form = $(this);
var data = form.serialize();
form.find('input[type="submit"]').attr('disabled', 'disabled');
$.ajax({
type: "POST",
url: "mailer/smart3.php",
data: data
}).done(function() {
form.find("input").val("");
$('#callModal1').modal('hide');
$("#modal_form1").trigger("reset");
});
return false;
});
$('#modal_form1').submit(function(){
var form = $(this);
var data = form.serialize();
form.find('input[type="submit"]').attr('disabled', 'disabled');
$.ajax({
type: "POST",
url: "mailer/smart3.php",
data: data
}).done(function() {
// выключаем субмит у формы
form.attr('disabled','disabled');
form.find("input").val("");
$('#callModal1').modal('hide');
$("#modal_form1").trigger("reset");
});
return false;
});