On Click -> multiple actions possible?

I’m try to achieve the following:

User clicks button, triggers 2 events:

  1. Downloads a file
  2. Displays a landing web page (to provide FAQs about the downloaded file).

I can achieve 1 OR 2 with On Click, but not both. Is there a way to do this on-click or perhaps the landing page initiates the download automatically?

Downloading a file is effectively navigating to a page, so you can’t achieve both.

However since navigating to a downloadable file bounces back to the original page, you can make the link on the original page navigate to the landing page, and in there trigger the download.

Triggering the download, which would be like automatically clicking a link, is not something that’s built-in in Sparkle.

You can add a tiny bit of code in an embed box to make it happen, say:

<script>
location.href="/downloads/file.zip";
</script>
2 Likes

@obdulax, A solution I have been working with is using the form/send button. A User puts in their name and when they hit the send button, instead of it going to a Thank You page, I have it going to a page with the information they need and the download.

1 Like

How do we customize this to add a downloaded file saved in the Sparkle docs/app? Normally we have the download file option from the button, but want to do this above mentioend way instead.

@Settide why don’t you just use a textbox with “Download File” and make it an onclick event with the action “download file” instead of using code? The text you can customise.

Trying to avoid having the user click. They click on the previous page which brings them to 1) new page, and 2) automatic download.

Ever thought of using the smartfield countdown?
When the countdown expires go to an external link for example. And this link points to the file you want to download.