1

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

Gabriel Solomon
  • 29,065
  • 15
  • 57
  • 79

2 Answers2

0

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

Auto start file download after form submission

Community
  • 1
  • 1
Rune
  • 8,340
  • 3
  • 34
  • 47
  • 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 – Gabriel Solomon Mar 15 '10 at 15:49
0

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();
    }
Gabriel Solomon
  • 29,065
  • 15
  • 57
  • 79