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 9077615
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T19:24:43+00:00 2026-06-16T19:24:43+00:00

Form contains show PDF button which sends POST request. This post request shows pdf

  • 0

Form contains show PDF button which sends POST request.
This post request shows pdf file using Content-disposition: inline or Content-disposition: attachment http header.

In Chrome double click in this button causes exception in controller probably becauses request
is executed two times concurrently.

How to prevent this so that double click in submit button executes request only once ?

Environment: ASP .NET MVC2 or Mono, jquery, jquery ui.

<form id="_form" method='post' target='_blank' action=''>
  .. form fields and other submit buttons
  <a href='#' id='_savepdf'>Show PDF</a>
</form>
<script type="text/javascript">
$(function () {
    $('#_savepdf').button();
    $('#_savepdf').click(function () { 
      $('#_form')[0].action= '/GetPDF'; 
      $('#_form')[0].submit(); 
     });
  });
</script>

Update

User may want to close pdf file and click or double click in this button again.
Only concurrent controller execution from same users should disabled. If controller has completed, button can clicked again.

  • 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-16T19:24:47+00:00Added an answer on June 16, 2026 at 7:24 pm

    You can disable the button after click so a user cannot click more than once.

    $('#_savepdf').button().click(function () { 
       $(this).button({disabled: true});
       $('#_form')[0].action= '/GetPDF'; 
       $('#_form')[0].submit(); 
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Form contains input elements and submit button. Pressing Submit button shows pdf file in
I have a form which contains rows like this one. I need to be
The situation is this: I have a Form which contains a DataGridView . That
I am using knockout.js and knockout.validation plugin. I have a search form which contains
I've created my own theme using HTML, CSS, JS which contains FORM (Emp_ID,Emp_Name, Address
I have a form which contains a lot of elements, my DB guy has
I am using .NET Windows Forms. My MDI parent form contains the menu. If
I have a small form which contains a first name, last name and a
I have a page in JQuery mobile, which contains a form. The form has
i have a form which is within a div, the form contains an input

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.