diff --git a/js/osticket.js b/js/osticket.js index 4e0d512de80aaa87a35deb5a0165b4da86ce3b82..9584b92f8352666a4a57b2247c0a33221fad4b25 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 2b346edcb469f9df5789ad3b591e6935b79bf473..cbccaed042289dd1ad8305bb21d2a96514f01482 100644 --- a/scp/js/scp.js +++ b/scp/js/scp.js @@ -166,7 +166,15 @@ var scp_prep = function() { $.toggleOverlay(true); // 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; });