diff --git a/application/views/customers/form.php b/application/views/customers/form.php index 47d14dc5f..95175f1e7 100644 --- a/application/views/customers/form.php +++ b/application/views/customers/form.php @@ -83,11 +83,10 @@ $(document).ready(function() submitHandler:function(form) { $(form).ajaxSubmit({ - beforeSerialize: setup_csrf_token(), success:function(response) { dialog_support.hide(); - table_support.handle_submit('', response); + table_support.handle_submit('', response); }, dataType:'json' }); diff --git a/application/views/items/form.php b/application/views/items/form.php index a114ef328..b0621ce2d 100644 --- a/application/views/items/form.php +++ b/application/views/items/form.php @@ -331,7 +331,6 @@ $('#item_form').validate($.extend({ submitHandler: function(form, event) { $(form).ajaxSubmit({ - beforeSerialize: setup_csrf_token, success: function(response) { var stay_open = dialog_support.clicked_id() != 'submit'; if (stay_open) diff --git a/application/views/partial/header_js.php b/application/views/partial/header_js.php index 647112d94..b7074213f 100644 --- a/application/views/partial/header_js.php +++ b/application/views/partial/header_js.php @@ -36,5 +36,11 @@ setup_csrf_token(); - $(document).ajaxComplete(setup_csrf_token); + $.ajaxSetup({ + dataFilter: function(data) { + setup_csrf_token(); + return data; + } + }); + \ No newline at end of file diff --git a/application/views/receivings/receiving.php b/application/views/receivings/receiving.php index 47416444d..01f95e962 100644 --- a/application/views/receivings/receiving.php +++ b/application/views/receivings/receiving.php @@ -85,7 +85,10 @@ if (isset($success)) 'item', 'id'=>'item', 'class'=>'form-control input-sm', 'size'=>'50', 'tabindex'=>'1')); ?>