I have an ASP.NET MVC form that returns a report as a File(...) result. This means that the browser stays on the current page after the file download is triggered. Using jQuery, I would like to disable the submit button and then re-enable it after the file returns. My code already disables the button just fine, however, I'm unable to find an event to hook into that is triggered after the file returns.
Here's what I have so far:
$(document).ready(function() {
$("#downloadForm").submit(function() {
$("#cmdSubmit").attr("disabled", "disabled");
$("#uiProgress").show();
});
});
What can I add to this to trigger when the form submit returns?