I have tried doing this using a suggestion made previously but I cannot seem to make it work. The file did not download. I just need for the form to download the file when the form is submitted.

You don't need much code for it. just goto contact form > select contact form > additional setting, paste below code.

document.addEventListener( 'wpcf7mailsent', function( event ) {
location = 'YOUR_PDF_URL';}, false );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.