diff --git a/js/osticket.js b/js/osticket.js index c88c925b8d8453fe1f102e2b7e0d28e6bd6eb472..95589f582fadd7768718b750cf924c1f07f7e04b 100644 --- a/js/osticket.js +++ b/js/osticket.js @@ -47,7 +47,15 @@ $(document).ready(function(){ $(window).unbind('beforeunload'); // Disable client-side Post Reply/Create Ticket buttons to help // prevent duplicate POST - $(':submit', $(this)).attr('disabled', true); + var form = $(this); + $(this).find('input[type="submit"]').each(function (index) { + // Clone original input + $(this).clone(false).removeAttr('id').prop('disabled', true).insertBefore($(this)); + + // Hide original input and add it to top of form + $(this).hide(); + form.prepend($(this)); + }); $('#overlay, #loading').show(); return true; }); diff --git a/scp/js/scp.js b/scp/js/scp.js index c6e6f3c877756bc9e568a931e7ba353af114d8e9..177c0a529ba89d1b7cb39a8ced8b855839dc2d77 100644 --- a/scp/js/scp.js +++ b/scp/js/scp.js @@ -165,7 +165,15 @@ var scp_prep = function() { $(window).unbind('beforeunload'); // Disable staff-side Post Reply/Open buttons to help prevent // duplicate POST - $(':submit', $(this)).attr('disabled', true); + var form = $(this); + $(this).find('input[type="submit"]').each(function (index) { + // Clone original input + $(this).clone(false).removeAttr('id').prop('disabled', true).insertBefore($(this)); + + // Hide original input and add it to top of form + $(this).hide(); + form.prepend($(this)); + }); $('#overlay, #loading').show(); return true; });