Open file on Submit | WordPress.org

[ad_1]

Im using WP. Id like to open am excel document in a new browser window when the user click on the submit button. The form will send and the document will open in new browser window . I have previously used this code to open a PDF on another page on my site. Ive noticed all my shortcodes have changed and this method does not seem to be working any more although the previous pages I created do still work with the old shortcodes.

This is the code I entered into an HTML snippit on my page that contains the form

<script>document.addEventListener( 'wpcf7mailsent', function( event ) {if ( '4147' == event.detail.contactFormId ) {window.open('link to document',  '_blank' // <- This is what makes it open in a new window.);}}, false );</script>

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer