submitHandler: function(form) {
$.ajax({
type: "POST",
url: "send.php",
data: $(form).serialize(),
success: function (response) {
alert(' the Form is submitted, we will contact you in 10 minutes.'); // This string would like to replace
$(form)[0].reset();
modal.removeClass('modal--visible');
},
error: function (response) {
console.error('request failed' + response);
}
});
}
<div id="alert" class="modal">
<div class="modal-content">
<span class="close">×</span>
<p>the Form is submitted, we will contact you in 10 minutes..</p>
</div>
</div>
.modal {
display: none;
position: fixed;
z-index: 1;
padding-top: 100px;
left: 0;
top: 0;
width: 100%;
height: 100%;
overflow: auto;
background-color: rgb(0,0,0);
background-color: rgba(0,0,0,0.4);
}
.modal-content {
background-color: #fefefe;
margin: auto;
padding: 20px;
border: 1px solid #888;
width: 80%;
}
.close {
color: #aaaaaa;
float: right;
font-size: 28px;
font-weight: bold;
}
.close:hover,
.close:focus {
color: #000;
text-decoration: none;
cursor: pointer;
}
submitHandler: function(form) {
$.ajax({
type: "POST",
url: "send.php",
data: $(form).serialize(),
success: function (response) {
(function() {
const alert = document.querySelector("#alert");
const close = document.querySelector(".close");
alert.style.display = "block";
close.addEventListener("click", function() {
alert.style.display = "none";
})
})();
$(form)[0].reset();
modal.removeClass('modal--visible');
},
error: function (response) {
console.error('request failed' + response);
}
});
}
Find more questions by tags JavaScript
location.href = "https://ссылка";
User will move to the specified page, and there already will post their gratitude. - archibald.Bogisich64 commented on April 19th 20 at 12:56