views:

408

answers:

2

Hello,

I have a form that as an action returns a download. The problem is that the page will pop-out the download, and you can save it, but it will not allow another form submit.

i was thinking of doing a page refresh after the submit. But i cant figure out how to do that and not stop the download. Do you have any ideas.

Thanks

A: 

Make the initial form POST to an action which returns the same view along with some javascript that triggers the download. Also provide a "Your download should start shortly. Otherwise, click here"-link.

Have a look at

http://stackoverflow.com/questions/1509116/auto-start-file-download-after-form-submission

Rune
i would prefer to keep the user in the same page, since he enters some information in the form. Its basicly a report download page and its easier for him to generate multiple reports if he remains in the same page
solomongaby
A: 

This seams to be a bug in Chrome. The solution i got from here was to open a window before submit and put the target of the form in that window.

    function submitForm() {
//next line is the FIX
      window.open('','google');
      form = document.getElementById('myform');
      form.action = "http://www.google.com/search";
      form.target = 'google';
      form.submit();
    }
solomongaby