Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8872083
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:08:24+00:00 2026-06-14T18:08:24+00:00

I have an expensive form action that builds a zip file on the server

  • 0

I have an expensive form action that builds a zip file on the server and returns it to the browser.

<form action='/download' method='post'>

<input type='submit' value='download'/>

</form>

I want to block the page on click of the button so that the user doesn’t repeatably hit the button.

However I want to unblock the page after the form returns.

How can trigger an event on successful completion of the form?

(I know I can trigger this by changing the form to be an ajax submission but then the save file dialog does not appear…)

Any suggestions?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T18:08:25+00:00Added an answer on June 14, 2026 at 6:08 pm

    One way you could handle this without using AJAX could be submitting the content of the form to an iframe element. If you attach an onsubmit function to the form that disables further submissions and attach an onload function to the iframe, you should be able to disable the user from submitting the form multiple times.

    Example HTML:

    <form action="/download" method="post" target="downloadFrame" onsubmit="return downloadFile();">
      <input type="submit" value="download" />
    </form>
    <iframe style="width: 0px; height: 0px;" scrolling="no" frameborder="0" border="0" name="downloadFrame" onload="downloadComplete();"></iframe>
    

    Example Javascript:

    var downloading = false;
    function downloadFile() {
        var isDownloading = downloading;
        downloading = true;
        return !isDownloading;
    }
    function downloadComplete() {
        downloading = false;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a rather extensive form which contains a file input. The form will
I have an expensive query using the row_number over() functionality in SQL Server 2005.
I have an expensive server side resource ( which is thread safe ). What
I have some python code that currently performs expensive computation by performing the computation
I have heard that DateTime.Now is very expensive call (from here ) Is GETDATE()
I have a object with properties that are expensive to compute, so they are
I have a form that does some extensive Javascript stuff before finally POSTing to
In short: I have a VB6 form with ActiveX control that contains buttons, and
I have a bunch of methods that all return a bool. If one method
I have a servlet that calls MySQL database. The deletePage method looks like this:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.