I have this problem in summary: when i fill my input automatically i display an array using ajax , and on the same table I shock a few lines and when I send back to my views through a button I have nothing that is displayed either at the console or the terminal.
Js & Ajax
enter code here
$(document).on("click","#final",function(){
const list_entrepot = getSelectedVals1();
const list_fournisseurs = getSelectedVals();
selection = {list_fournisseurs,list_entrepot};
$.ajax({
async: false,
type : "GET",
url : 'fournisseur_ajax',
data :{
'csrfmiddlewaretoken': csrf,
'selection':selection,
},
success : (res) =>{
console.log(res.data)
}
});
});
function getSelectedVals(){
var tmp =[];
$("input[name='fournisseur_tab']").each(function() {
if ($(this).prop('checked'))
{
checked = ($(this).val());
tmp.push(checked);
}
});
var filters = tmp.join(',');
console.log(filters)
return filters;
}