Answer the question
In order to leave comments, you need to log in
How to close a form in cf7 after successful submission?
How to close a form in cf7 after successful submission?
I use remodal for a modal window in which there is a form
in remodal, the window closes, for example. button with date attribute data-remodal-action="close"
<button class="close" title="Закрыть окно" data-remodal-action="close"></button>
Answer the question
In order to leave comments, you need to log in
Something like this, you can finish it a bit .. the form will close 3 seconds after sending
document.addEventListener( 'wpcf7mailsent', function( event ) {
if ('ТУТ ID ФОРМЫ ЦИФРЫ' == event.detail.contactFormId) {
setTimeout(function(){ // закрытие модальки
$( ".close" ).trigger( "click" ); // клик по кнопке
}, 3000);
}
}, false );
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question