Title: JavaScript form events
Last modified: October 14, 2020

---

# JavaScript form events

 *  Resolved [punktbiz](https://wordpress.org/support/users/punktbiz/)
 * (@punktbiz)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/javascript-form-events/)
 * Hello team,
    Just trying to put in practice the “JavaScript form events” capability
   to resolve one problem with my client. What does it mean the variable “data” 
   in the script below? I’m trying to access a hidden variable of the form after
   the event “suscribed” to customize the behavior after subscription, but not sure
   how to do that. Perhaps the “data” variable stores that information. It would
   be great if you could help me on that. Thanks, Guido
 * <script>
    mc4wp.forms.on(’15.success’, function(form, data) { // your code goes
   here console.log(“Form with ID 15 successfully submitted.”); }); </script>
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fjavascript-form-events%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Contributor [Lap](https://wordpress.org/support/users/lapzor/)
 * (@lapzor)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/javascript-form-events/#post-13533612)
 * If you use this code:
 * <script type=”text/javascript”>
    mc4wp.forms.on(‘subscribed’, function(form,data){
   console.log(form); console.log(data); }); </script>
 * and check your console, you will see the form contains basically everything related
   to the form.
 * Data contains just the submitted fields and their values, as an object.
 * Hope that helps. If you have any questions, please let me know!
 *  Thread Starter [punktbiz](https://wordpress.org/support/users/punktbiz/)
 * (@punktbiz)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/javascript-form-events/#post-13534564)
 * Perfect, thank you for your support. Guido

Viewing 2 replies - 1 through 2 (of 2 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/)

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