Answer the question
In order to leave comments, you need to log in
Wordpress, Contact Form 7. How to correctly write Javascript to call popup after clicking on the Submit button?
Help! Need help setting up a template in WP. There is a window that should open after an action is performed, namely submitting the form, the "Submit" button in Contact Form 7.
The window itself has the following content:
<div class="popup js-popup form-answer" data-modal="form-answer">...</div>
<a href="#" class="js-popup form-answer" data-target="form-answer" >Открыть окно</a>
add_action( 'wp_footer', 'mycustom_wp_footer' );
function mycustom_wp_footer() {
?>
<script type="text/javascript">
document.addEventListener( 'wpcf7mailsent', function( event ) {
if ( '10' == event.detail.contactFormId ) {
???????????????????????????????????????????????????????????????????????????
}
}, false );
</script>
<?php
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question