Hey Matzinger, yes there is a reason we using the form instead of as button. I know how to open in new tab on a normal button but having trouble with the form submit one even with the target _blank inserted
I had the same problem. I solve it with some custom code.
I have a form where people are supose to put their email adress, then they hit the submit button and the PDF open in another tab. And of course, I want only people who have given their email address to see the PDF.
To make this work you need to :
give an ID to the field where people enter the address (in the script “ID-of-the-email-field-in-form”)
give an ID to the submit button. (in the script “ID-of-the-send-button-of-the-form”)
What the script does is simple: it waits for a click on the button (button.AddEvent…). When there is a click on the button it looks at what is in the address field*(document.getElementById(“ID-of-the-email-field-in-form”).value)*. If there is something then it launches “window.open” which opens the new tab with the pdf file.
Hey there Romuald_Jay! This is exactly what I am looking for, but where does the custom code go on the page? I added it in a code block, but it’s not working currently. Thank you!