diff --git a/application/views/partial/header_js.php b/application/views/partial/header_js.php index 212a0b54d..027026944 100644 --- a/application/views/partial/header_js.php +++ b/application/views/partial/header_js.php @@ -44,6 +44,13 @@ } }); + var submit = $.fn.submit; + + $.fn.submit = function() { + setup_csrf_token(); + submit.apply(this, arguments); + }; + session_sha1 = 'session->userdata('session_sha1'); ?>'; diff --git a/application/views/receivings/receiving.php b/application/views/receivings/receiving.php index 1ddd6ed72..fd3a9fef3 100644 --- a/application/views/receivings/receiving.php +++ b/application/views/receivings/receiving.php @@ -414,7 +414,6 @@ $(document).ready(function() autoFocus: false, select: function (a, ui) { $(this).val(ui.item.value); - setup_csrf_token(); $("#add_item_form").submit(); return false; } @@ -424,7 +423,6 @@ $(document).ready(function() $('#item').keypress(function (e) { if (e.which == 13) { - setup_csrf_token(); $('#add_item_form').submit(); return false; } diff --git a/application/views/sales/register.php b/application/views/sales/register.php index ffb50debe..50cede8c7 100644 --- a/application/views/sales/register.php +++ b/application/views/sales/register.php @@ -527,7 +527,6 @@ $(document).ready(function() delay: 500, select: function (a, ui) { $(this).val(ui.item.value); - setup_csrf_token(); $("#add_item_form").submit(); return false; } @@ -537,7 +536,6 @@ $(document).ready(function() $('#item').keypress(function (e) { if (e.which == 13) { - setup_csrf_token(); $('#add_item_form').submit(); return false; }