• Resolved punktbiz

    (@punktbiz)


    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 to see the link]

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

    (@lapzor)

    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

    (@punktbiz)

    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.