Title: JavaScript form events
Last modified: March 26, 2021

---

# JavaScript form events

 *  Resolved [errorx](https://wordpress.org/support/users/errorx/)
 * (@errorx)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/javascript-form-events-2/)
 * Hello,
    i’m trying to get the javascript form events to work as described here:
   [https://www.mc4wp.com/kb/javascript-form-events/](https://www.mc4wp.com/kb/javascript-form-events/)
 * Unfortunately, none of the events work except the first one ‘started’ which prints
   out a message in the console just fine, but the others do not work.
 * I am interested in the success event, so i’ve tried:
 * <script>
    mc4wp.forms.on(’15.success’, function(form, data) { // your code goes
   here console.log(“Form with ID 15 successfully submitted.”); }); </script>
 * Of course i changed ’15’ with my form ID number, but no message is printed in
   the console and i cannot continue with calling the other functions i need.
 * Please advise. I can send you the website link to the support email if it’s appropriate,
   since i don’t want to publicly place my link here.
 * NOTE: I have a caching plugin installed and i tried without it enabled, but the
   problem still persists.
 * Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Contributor [Harish Chouhan](https://wordpress.org/support/users/hchouhan/)
 * (@hchouhan)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/javascript-form-events-2/#post-14242048)
 * Hey [@errorx](https://wordpress.org/support/users/errorx/),
 * Can you please share the exact JavaScript code you are testing which includes
   the custom code for the success event?
 *  Thread Starter [errorx](https://wordpress.org/support/users/errorx/)
 * (@errorx)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/javascript-form-events-2/#post-14242064)
 * As i mentioned above i have added the code below. 1691 is my form ID. The code
   is added in the form builder, right under the actual code for the form.
 * After i submit the form, i get the default sign up success message under the 
   it, but the console log is not outputting anything.
 * <script>
    mc4wp.forms.on(’1691.success’, function(form, data) { // your code 
   goes here console.log(“Form with ID 1691 successfully submitted.”); }); </script
   >
 *  Plugin Contributor [Lap](https://wordpress.org/support/users/lapzor/)
 * (@lapzor)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/javascript-form-events-2/#post-14242114)
 * Please share a link to where I can see this on your website so I can take a look
   at this. Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘JavaScript form events’ is closed to new replies.

 * ![](https://ps.w.org/mailchimp-for-wp/assets/icon-256x256.png?rev=1224577)
 * [MC4WP: Mailchimp for WordPress](https://wordpress.org/plugins/mailchimp-for-wp/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/mailchimp-for-wp/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/mailchimp-for-wp/)
 * [Active Topics](https://wordpress.org/support/plugin/mailchimp-for-wp/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/mailchimp-for-wp/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/mailchimp-for-wp/reviews/)

 * 3 replies
 * 3 participants
 * Last reply from: [Lap](https://wordpress.org/support/users/lapzor/)
 * Last activity: [5 years, 2 months ago](https://wordpress.org/support/topic/javascript-form-events-2/#post-14242114)
 * Status: resolved