[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>
