• Resolved elbomnetanel

    (@elbomnetanel)


    ive tried to use

    document.addEventListener( 'submit', function( event ) {
    fbq('track', 'Lead');
    }, false );

    but it doesnt work… click instead of submit works but it’s not good, because i want to trigger this only if the form has been sent successfuly.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Williams – WPMU DEV Support

    (@wpmudev-support8)

    Hi @elbomnetanel

    I hope you’re well today and thank you for your question!

    Try this way please:

    <script type="text/javascript">
    jQuery(function($){
    $(document).on( 'forminator:form:submit:success', function() {
    fbq('track', 'Lead');
    } );
    });
    </script>

    You should also be able to fire your code on failed submission in a similar way, just use

    forminator:form:submit:failed

    instead of

    forminator:form:submit:success

    Best regards,
    Adam

    Thread Starter elbomnetanel

    (@elbomnetanel)

    Thanks! it works ??

    Plugin Support Imran – WPMU DEV Support

    (@wpmudev-support9)

    Hello @elbomnetanel

    I hope you are doing well!

    Glad to know that the issue is resolved. I’ve marked this ticket as resolved. If you do have any followup questions or require further assistance feel free to reopen it and let us know here.

    Kind regards,
    Nastia

    I have two forms in one page.

    how can i trigger the form success of each one?

    ex)
    $(document).on( ‘forminator:form-758:submit:success’, function(data) { $(‘.step1’).show();
    } );

    $(document).on( ‘forminator:form-759:submit:success’, function(data) { $(‘.step2’).show();
    } );

    Plugin Support Patrick – WPMU DEV Support

    (@wpmudevsupport12)

    Hi @byron222

    I hope you are doing well.

    Each form has its own ID, you can use to select on JavaScript and run the function.

    Could you please create a new ticket and we can take a closer look on your website?

    Best Regards
    Patrick Freitas

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to issue a script after form submit?’ is closed to new replies.