Hi,
What I want to happen specifically on my site is this:
- A user on a product page clicks on the “Spec Sheet” button
- A lightbox pops up with a form prompting them to enter their email in order to download the spec sheet
THE PART WHERE I NEED HELP ↓
- The user clicks on the “download” button, which submits their email AND opens a new window with the PDF/link.
Note: I realize that this is easy to do with pretty much any other wix button, but it is not a built-in option on form/submit buttons, so I figure the only option is to add it with code.
I’ve already reviewed the solutions provided in these posts here:
But, I wanted to see if there is a better way to do this, especially since I don’t want to necessarily “redirect” from the current page, I just want a link to open in a new page.
Here is the code I have added:
import wixLocation from 'wix-location';
export function button3_click(event, $w) {
wixLocation.to("https://docs.talen-x.com/ProductSummaries/BroadSense.pdf");
}
UPDATE: I have considered a different coded solution where I leave the submit button as is, and add a separate “download” button that is hidden upon the page loading, but appears when the submit button is clicked and is placed exactly above the submit button. And since it would be a regular button it has the built in option of opening a new window.
BUT, I still want to hear your feedback first
Thank you!!
-Rachael