diff --git a/src/scripts/coopstarter.js b/src/scripts/coopstarter.js index af78327f151318760b3e2b945dc8fde020d0276b..9f321b652d994d70c548a6bbe8409971cc850388 100644 --- a/src/scripts/coopstarter.js +++ b/src/scripts/coopstarter.js @@ -144,15 +144,21 @@ function refreshPagination() { * @param {HTMLElement} option_selected - Option selcted to set in hidden select. */ function selectHiddenManagement(select_hidden, option_selected) { + console.log("option_selected in selectHiddenManagement", option_selected) + console.log("select_hidden in selectHiddenManagement", select_hidden) options_hidden = select_hidden.getElementsByTagName("option"); for (let option_hidden of options_hidden) { //Removing the selected attribute from previous selection option_hidden.removeAttribute("selected"); - + console.log("option_hidden.value",option_hidden.value) + console.log("option_selected.value",option_selected.value) if (option_hidden.value == option_selected.value) { +console.log("we change the value") //Actually selecting the option if it is the good one option_hidden.setAttribute("selected", "selected"); select_hidden.setAttribute("value", option_selected.value); + console.log("select_hidden", select_hidden) + break; } } @@ -494,7 +500,8 @@ function addProperFilterToSearchComponents(targetId) { let instance_only = baseElement.querySelectorAll( ".instance_database_only" )[0]; - if (instance_only) { + + if (instance_only){ let checkbox_instance_only = instance_only.querySelector("input"); if (checkbox_instance_only) { checkbox_instance_only.onclick = function() { @@ -505,6 +512,7 @@ function addProperFilterToSearchComponents(targetId) { }; } } + //MORE CRITERIAS const more_criterias_form = baseElement.querySelectorAll( @@ -546,7 +554,8 @@ function addProperFilterToSearchComponents(targetId) { let language_field_search = more_criterias_form.querySelector( `select[name="language"]` ); - language_hidden_field = baseElement.querySelectorAll( + + let language_hidden_field = baseElement.querySelectorAll( 'hidden-widget[name="more_criterias_hidden"] select[name="language"]' ); @@ -570,7 +579,7 @@ function addProperFilterToSearchComponents(targetId) { 'hidden-widget[name="more_criterias_hidden"] select[name="fields"]' ); - if (language_field_search) { + if (field_field_search) { field_field_search.onchange = function() { let option_selected = field_field_search.querySelector( "option:checked"