• As the title says, I have an Event Listener for a successful mail sent on a form. In Safari 8 and IOS 8 nothing happens, no error. It works in Safari 10 and all other current browsers.

    This seems to be a widespread issue.

    Has anyone resolved this problem?

    If I use on_sent_ok on the same form, will it clash with addEventListener?

Viewing 2 replies - 1 through 2 (of 2 total)
  • btalebpour

    (@btalebpour)

    You are lucky that it works somewhere at least. For me it doesn’t work in any of the browsers I tried: Chrome, IE 10, Firefox and Safari. It used to work when I used on_sent_on but now, after a couple of months, neither works with that setting nor by the new way that Contact Form mentioned it on their site (adding wpcf7mailsent to the listener).

    Thread Starter chrispink

    (@chrispink)

    It certainly should do. It’s working on this page; goo.gl/9ck5ZG

    So it might just be a code error.

    The function looks like this – dependent on jQuery – hides the form and presents a download button.

    add_action( ‘wp_footer’, ‘wp2485722_wpcf7_on_sent’ );

    function wp2485722_wpcf7_on_sent() { ?>

    <script type=”text/javascript”>
    document.addEventListener( ‘wpcf7mailsent’, function( event ) {
    if ( ‘11875’ == event.detail.contactFormId ) // FORM ID {
    jQuery(‘#download-button’).slideDown();
    jQuery(‘.inline-breakout .wpcf7’).hide();
    }
    }, true );
    </script>

    <? }

    • This reply was modified 7 years ago by chrispink.
    • This reply was modified 7 years ago by chrispink.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Event Listener wpcf7mailsent not firing in Safari 8, IOS8 (addEventListener)’ is closed to new replies.