How to make a window of gratitude after sending the form, but not through the alert?

Is the form submitting, there appears the window of gratitude, but alert. How to make somehow in another way, not through the alert?

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);
}
});
 }
April 19th 20 at 12:48
2 answers
April 19th 20 at 12:50
<div id="alert" class="modal">
 <div class="modal-content">
 <span class="close">&times;</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);
}
});
}
ohh...gods,still to understand. I understand html code I don't need,since I have my window,like that there must otkovyryat js form submit and the message window gratitude. - margarett.Kirlin commented on April 19th 20 at 12:53
@margarett.Kirlin, everything is much easier, instead of alert, use:
location.href = "https://ссылка";
User will move to the specified page, and there already will post their gratitude. - geovanni0 commented on April 19th 20 at 12:56
@geovanni0, woooooot!!!! Here is what I need as a beginner !!!! Thank you !!!!!! - margarett.Kirlin commented on April 19th 20 at 12:59
April 19th 20 at 12:52


stylize the window and hide it by default when necessary - add a class to make it visible

Find more questions by tags JavaScript