From 20bb5c4ac6817e3b3580b80bcd56dbb1ac0f3950 Mon Sep 17 00:00:00 2001 From: Peter Rotich <peter@osticket.com> Date: Wed, 12 Aug 2015 11:19:26 +0000 Subject: [PATCH] bug: Not every form has action attr. --- scp/js/scp.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scp/js/scp.js b/scp/js/scp.js index 7d2bc0190..a47af3361 100644 --- a/scp/js/scp.js +++ b/scp/js/scp.js @@ -970,7 +970,7 @@ $.changeHash = function(hash, quiet) { // Forms — submit, stay on same tab $(document).on('submit', 'form', function() { - if ($(this).attr('action').indexOf('#') == -1) + if (!!$(this).attr('action') && $(this).attr('action').indexOf('#') == -1) $(this).attr('action', $(this).attr('action') + window.location.hash); }); -- GitLab