From 14e82b35f07deeba91875b91be6a5479bbcd7712 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 4 Oct 2018 22:50:20 +0200 Subject: JS: fix bad cleary of csrf input --- ishtar_common/static/js/ishtar.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'ishtar_common') diff --git a/ishtar_common/static/js/ishtar.js b/ishtar_common/static/js/ishtar.js index 9cc9d3df9..184b1eff7 100644 --- a/ishtar_common/static/js/ishtar.js +++ b/ishtar_common/static/js/ishtar.js @@ -705,8 +705,16 @@ function clear_search_field(){ function _clear_search_criteria_fields(query){ var datatables_length = $(".dataTables_length select").val(); document.getElementById('wizard-form').reset(); - // some input seems to be not cleared... - $('#wizard-form input').each(function(){$(this).val("")}); + // hidden input are not cleared + $('#wizard-form input').each( + function(){ + if($(this).attr("name") != 'csrfmiddlewaretoken'){ + $(this).val("") + } else { + console.log('test'); + } + } + ); $(".dataTables_length select").val(datatables_length); $('.dataTables_length select option[value="' + datatables_length + '"]' ).prop('selected', true); -- cgit v1.2.3