Share:
  • 19
  •  
  •  
  •  
  •  
  •  
    19
    Shares

A common issue with form submissions is the user double-clicking the submit button and the form information being duplicated. Here is a simple solution to fix this issue.

The one thing that you have to do is make sure the form is still submitted and then the button is disabled. You can not just disable the button on click, the form will not be submitted. Here is a solution that submits the form then disables the button.

$("#CreditImport").submit(function () {
     $("#RunSubmit").prop('disabled', true);     
     e.preventDefault(); 
     return false;
});

So the form has an ID of “CreditImport” and on submitting, the button with an ID of “RunSubmit” is then disabled preventing the user from clicking it again.


Share:
  • 19
  •  
  •  
  •  
  •  
  •  
    19
    Shares