• Resolved errorx

    (@errorx)


    Hello,
    i’m trying to get the javascript form events to work as described here: 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

    (@hchouhan)

    Hey @errorx,

    Can you please share the exact JavaScript code you are testing which includes the custom code for the success event?

    Thread Starter errorx

    (@errorx)

    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

    (@lapzor)

    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.