• Hi i explain my issue, i have 2 equal contact form in 2 different pages and i will create others to put in others pages. So, I entered the following code in header.php

    <script>
    document.addEventListener( ‘wpcf7mailsent’, function( event ) {
    location = ‘/thankyoupage’;
    }, false );
    </script>

    and redirection runs only with the contact form in contact page. I dont know why!!

    Than I replaced the previous code with the following

    <script>
    document.addEventListener( ‘wpcf7mailsent’, function( event ) {
    if ( ‘123’ == event.detail.contactFormId ) {
    location = ‘/thankyoupage’;
    }
    }, false );
    </script>

    than the contact form that’s in contact page doesnt run as the second contact form that have 123 as id.

    I tried the same in footer.php and nothing is changed.

    Could someone please help me?

  • The topic ‘Dom events’ is closed to new replies.