Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
https://codepen.io/antipetya/pen/KJrwrK
bfy.tw/MKDZ
The answer was right there
Submitting the form without reloading the page?
Instead of alert("Thanks");
Write what you want.
You can, for example, erase the shape, and instead draw a hidden DIV with thanks, which you design at your discretion.
using jQuery it might look something like this
HTML:
<div id="container1">
//здесь ваша форма
</div>
<div id="container2">
//здесь благодарности
</div>
function fadeonsuccess() {
$('#container1').fadeOut(700, "linear", function(){
$('#container2').delay(400).fadeIn(700, "linear").delay(3000).fadeOut(700, "linear", function(){
formreset();
$('#container1').fadeIn(700);
});
});
}
All the same, it’s not worth making such gaps on the site?
1) How about placing the gratitude form (html) in the gratitude_form.php file
2) Let's still use the ajax object correctly and fully, and upon successful submission of the first form, we will do $.ajax( {...}.success( function () { ... } ) )
3) In the .success() function, it is worth unloading our gratitude_form.php file into the container we need using the same require_once or get the form html as a string and make $( "container_ID" ) in js. text("form_html_string" )
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question