Support » Plugin: Contact Form 7 » cant redirect to download PDF

  • Resolved dorondav

    (@dorondav)


    Hi
    I’m taring to open a PDF in a new window after form is submitted, but it doesn’t work.
    i’v seen a couple of tutorials and deterrent approaches.
    but is all ways the same javascript code (and it doesn’t work at all).

    1) put js the script in the child theme header directly
    2) php function in the child theme function.php

    the JS code:

    <script type=”text/javascript”>
    document.addEventListener( ‘wpcf7mailsent’, function( event ) {
    if ( ‘1188’ == event.detail.contactFormId ) {
    window.location.href = ‘https://e2youngengineers.org/wp-content/uploads/2019/07/Young-Engineers-Franchise-Report.pdf&#8217;;
    }else{
    echo ‘error: no redirection’;
    }
    }, false );
    </script>

    the form i’t self is on deme: on

    please help me understand way it doesn’t work

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘cant redirect to download PDF’ is closed to new replies.