Title: Javascript event after message
Last modified: November 30, 2018

---

# Javascript event after message

 *  Resolved [Dan Miller Coding](https://wordpress.org/support/users/danmillercoding/)
 * (@danmillercoding)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/javascript-event-after-message/)
 * 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](https://wordpress.org/support/users/yikesitskevin/)
 * (@yikesitskevin)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/javascript-event-after-message/#post-10941610)
 * Hi [@danmillercoding](https://wordpress.org/support/users/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/](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 7 years, 4 months ago by [yikesitskevin](https://wordpress.org/support/users/yikesitskevin/).
 *  Thread Starter [Dan Miller Coding](https://wordpress.org/support/users/danmillercoding/)
 * (@danmillercoding)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/javascript-event-after-message/#post-10970174)
 * Hi [@yikesitskevin](https://wordpress.org/support/users/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.

 * ![](https://s.w.org/plugins/geopattern-icon/yikes-inc-easy-mailchimp-extender_a1c7e5.
   svg)
 * [Easy Forms for Mailchimp](https://wordpress.org/plugins/yikes-inc-easy-mailchimp-extender/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/yikes-inc-easy-mailchimp-extender/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/yikes-inc-easy-mailchimp-extender/)
 * [Active Topics](https://wordpress.org/support/plugin/yikes-inc-easy-mailchimp-extender/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/yikes-inc-easy-mailchimp-extender/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/yikes-inc-easy-mailchimp-extender/reviews/)

## Tags

 * [event](https://wordpress.org/support/topic-tag/event/)
 * [hide](https://wordpress.org/support/topic-tag/hide/)
 * [javascript](https://wordpress.org/support/topic-tag/javascript/)
 * [jquery](https://wordpress.org/support/topic-tag/jquery/)
 * [message](https://wordpress.org/support/topic-tag/message/)
 * [submit](https://wordpress.org/support/topic-tag/submit/)
 * [trigger](https://wordpress.org/support/topic-tag/trigger/)

 * 2 replies
 * 2 participants
 * Last reply from: [Dan Miller Coding](https://wordpress.org/support/users/danmillercoding/)
 * Last activity: [7 years, 4 months ago](https://wordpress.org/support/topic/javascript-event-after-message/#post-10970174)
 * Status: resolved