My CH is connected to a field in the database, as the values that are selected are inserted into an array?
My CH is connected to a field in the database, as the values that are selected are inserted into an array?
First it is required to generate a variable of type array, later generate a loop and inside the loop using selectors css and jquery you can iterate according to the selected checkboxes that exist ... it would be something like the following:
<input type="checkbox" name="check" value="A" />
<input type="checkbox" name="check" value="B" />
<input type="checkbox" name="check" value="C" />
<input type="checkbox" name="check" value="D" />
var arr = [];
$("input:checkbox[name=check]:checked").each(function(){
arr.push($(this).val());
});
console.log(arr); // print de los items add dentro de tu array...
I hope you find it useful, greetings.