Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi Ricky55!

    <script type=”text/javascript”>
    document.addEventListener( ‘wpcf7mailsent’, function( event ) {
    if ( ‘123’ == event.detail.contactFormId ) { // First Form
    location = ‘https://example.com/&#8217;;
    }
    else if ( ‘123’ == event.detail.contactFormId ) { // SecondForm
    location = ‘https://example.com/&#8217;;
    }
    }, false );
    </script>

    Thread Starter Ricky55

    (@ricky55)

    Thanks man!! Sorry for if this is a silly question but can I ask.

    The 123 what will be substituted with?

    Also my second form just wants to exhibit normal behaviour so how can I say if it’s this form do nothing effectively?

    Thanks

    Just replace the “123” with the form ID

    Then if you only want to redirect the first form then just use this one instead:

    <script type=”text/javascript”>
    document.addEventListener( ‘wpcf7mailsent’, function( event ) {
    if ( ‘123’ == event.detail.contactFormId ) {
    location = ‘https://example.com/’;
    }
    }, false );
    </script>

    I hope it helps!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Redirect code for specific form’ is closed to new replies.