Skip to content
Snippets Groups Projects
Commit 4414f9bb authored by JediKev's avatar JediKev
Browse files

issue: Duplicate Page Requests

This addresses an issue where clicking Open, Post Reply, etc. more than once
whilst creating/responding to a ticket will generate duplicate requests.
This causes duplicate responses to be sent out or duplicate tickets being
created. This adds jQuery, on both Agent and User side, to disable the
submit buttons when the "Loading" popup appears so you cannot click the
button more than once.
parent b19cf261
No related branches found
No related tags found
No related merge requests found
...@@ -45,6 +45,9 @@ $(document).ready(function(){ ...@@ -45,6 +45,9 @@ $(document).ready(function(){
$('form').submit(function() { $('form').submit(function() {
$(window).unbind('beforeunload'); $(window).unbind('beforeunload');
// Disable client-side Post Reply/Create Ticket buttons to help
// prevent duplicate POST
$(':submit', $(this)).attr('disabled', true);
$('#overlay, #loading').show(); $('#overlay, #loading').show();
return true; return true;
}); });
......
...@@ -163,6 +163,9 @@ var scp_prep = function() { ...@@ -163,6 +163,9 @@ var scp_prep = function() {
$('form.save, form:has(table.list)').submit(function() { $('form.save, form:has(table.list)').submit(function() {
$(window).unbind('beforeunload'); $(window).unbind('beforeunload');
// Disable staff-side Post Reply/Open buttons to help prevent
// duplicate POST
$(':submit', $(this)).attr('disabled', true);
$('#overlay, #loading').show(); $('#overlay, #loading').show();
return true; return true;
}); });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment