$(function() {
$('#callBack').submit(function(e) {
var $form = $(this);
e.preventDefault();
if (!test2) {
$.ajax({
type: $form.attr('method'),
url: $form.attr('action'),
data: $form.serialize()
})
.done(function() {
// stateFunc = "success";
toggleCall();
toggleCallModalThx();
})
.fail(function() {
toggleCall();
console.log('Fail');
});
} else {
return;
}
});
});
$(function() {
$('#callBack').submit(function(e) {
e.preventDefault();
var $form = $(this);
if (stateFunc) {
return
}
$.ajax({
type: $form.attr('method'),
url: $form.attr('action'),
data: $form.serialize()
})
.done(function() {
stateFunc = "success";
toggleCall();
toggleCallModalThx();
})
.fail(function() {
toggleCall();
console.log('Fail');
});
});
});
$(function() {
$('#callBack').submit(function(e) {
var $form = $(this);
if ($(this).hasAttribute('data-formSended')) {
return
}
$.ajax({
type: $form.attr('method'),
url: $form.attr('action'),
data: $form.serialize()
})
.done(function() {
$(this).addAttribute('data-formSended')
toggleCall();
toggleCallModalThx();
})
.fail(function() {
toggleCall();
console.log('Fail');
});
e.preventDefault();
});
});
$(function() {
$('#callBack').submit(function(e) {
var $form = $(this);
if (stateFunc) {
return
}
$.ajax({
type: $form.attr('method'),
url: $form.attr('action'),
data: $form.serialize()
})
.done(function() {
stateFunc = "success";
toggleCall();
toggleCallModalThx();
})
.fail(function() {
toggleCall();
console.log('Fail');
});
e.preventDefault();
});
});
.callModal {
z-index: 3;
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
opacity: 0;
background-color: rgba(0, 0, 0, 0.6);
visibility: hidden;
transform: scale(1.1);
transition: visibility 0s linear 0.25s, opacity 0.25s 0s, transform 0.25s;
}