Support » Plugin: Easy Forms for Mailchimp » Javascript event after message

  • Resolved Dan Miller Coding

    (@danmillercoding)


    I’d like to trigger a Javascript event after the form has been submitted.

    More specifically I want the message to disappear after a few seconds.

    How can I do this?

    Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor yikesitskevin

    (@yikesitskevin)

    Hi @danmillercoding,

    We have two events (functions) that we fire off after a submission. They’re supposed to be for Google Analytics but you could use them for anything you’d like. Here’s an article about it: https://yikesplugins.com/support/knowledge-base/add-google-analytics-event-tracking/

    And here’s the basic JavaScript portion…

    function yikes_mailchimp_hide_feedback_message() {
        // Hide the success/error message after 3 seconds.
        setTimeout( function() {
            jQuery( '.yikes-easy-mc-error-message, .yikes-easy-mc-success-message' ).fadeOut();
        }, 3000 ); 
    }
    function yikes_mailchimp_google_analytics_failure() {
        yikes_mailchimp_hide_feedback_message();
    }
    
    function yikes_mailchimp_google_analytics_success() {
        yikes_mailchimp_hide_feedback_message();
    }

    Let me know if that makes sense.

    Cheers,
    Kevin.

    • This reply was modified 2 years, 9 months ago by yikesitskevin.
    Thread Starter Dan Miller Coding

    (@danmillercoding)

    Hi @yikesitskevin,

    Thank you so much for your response!

    I’ll definitely try this out and let you know how it goes.

    Cheers!
    Dan

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Javascript event after message’ is closed to new replies.