Confirmation box dialog - Download and redirect?

  • 18 October 2016
  • 2 replies
  • 8 views

Hey there just wondering if anyone knew of a way that I can redirect someone to another page via the button once the form has been submitted but at the same time download the asset…?

Pretty confusing but I need this for a client!

Thanks in advance 🙂


2 replies

Userlevel 7
Badge +4

Hey @erayner! I have a piece of code that redirects the visitor at the form confirmation dialogue. Would that work for you in this case? Simply throw this code into your form confirmation dialogue as a script, with before body end tag as the placement.

<script>
 
  (function(){
  
    // Your URL
    var url = 'https://your.urlredirect.com/';
  
    // Delay before the redirect takes place, in seconds
    var delay = 0;
    
     window.setTimeout(function() {
      window.open(url, '_top');
    }, delay * 1000);
  
  })();
 
</script>
Userlevel 6
Badge +1

@erayner not sure why you would do this? It would be pretty confusing to the visitor. I would not want to be downloading something in the background and them be re-directed to another url Feels kinda sketch to me. IMHO.

But, @Stefano should work fine.

Reply