2

After an html form is submitted on my website, the data from the form is passed to a script which does some processing and creates an xls file that is then returned to the browser via Flask's send_file.

Once that happens, I would like part of the form to be reset - specifically there is a submit button that I grey out after form submission so it can't repeatedly be clicked that I would like to make active again.

My understanding is that one request can only have one response - so there's no way to render_template after the send_file return. Is there a way around this? Or perhaps some other solution?

Thanks for any help you can give me.

DyRuss
  • 492
  • 4
  • 12
  • You may find [the techniques outlined in this answer](http://stackoverflow.com/a/4168965/135978) to be of some use. – Sean Vieira Apr 10 '15 at 21:01

1 Answers1

0

If you're using flask-wtf, you can reset the form's fields once the form has been validated:

form.file_uploaded.data = None