I am making a registration form where I have all the days of the week to select
<input type="checkbox" name="dias[]" value="Segunda"> Seg
<input type="checkbox" name="dias[]" value="Terça"> Ter
<input type="checkbox" name="dias[]" value="Quarta"> Qua
<input type="checkbox" name="dias[]" value="Quinta"> Qui
<input type="checkbox" name="dias[]" value="Sexta"> Sex
<input type="checkbox" name="dias[]" value="Sábado"> Sáb
<input type="checkbox" name="dias[]" value="Domingo"> Dom
The problem is that the form has a Add +1 button where this checkbox group doubles. As a checkbox I put name
of it as array
and if you have more than one checkbox group I do not know how to do it, since I need to get group by group, that is, if I have a group I will only do one foreach()
with PHP and solve the case, since the indexes will be 0 to 6 (because they are 7 days). Now if you have 2 groups, the indexes will be from 0 to 13 and every 7 is a group and I need to divide those groups.