samedi 21 novembre 2020

retrieve several groups of (checkbox with the same "name") with the POST method

I have a form with possible "activities" for the year or quarter 1, 2, 3 I simplify the form here for more readability (there is java script so that if the year is checked, the quarters are not checked and if a quarter is checked the year can no longer be checked)


<input type ="text" name='ID_Activite' id='ID_Activite' value =1 >              
<input type="checkbox" name='Activité_1' id='Année_1'  value='Année_1' >                
<input type="checkbox" name='Activité_1' id='Trimestre_1'  value='Trimestre_1'> 
<input type="checkbox" name='Activité_1' id='Trimestre_2' value='Trimestre_2'>
<input type="checkbox" name='Activité_1' id='Trimestre_3' value='Trimestre_3'>

<input type ="text" name='ID_Activite' id='ID_Activite' value =2 >              
<input type="checkbox" name='Activité_2' id='Année_1'  value='Année_1'  >                   
<input type="checkbox" name='Activité_2' id='Trimestre_1'  value='Trimestre_1'> 
<input type="checkbox" name='Activité_2' id='Trimestre_2' value='Trimestre_2'>
<input type="checkbox" name='Activité_2' id='Trimestre_3' value='Trimestre_3'>

I know how to get a group of checkboxes with the same 'name' with the POST method but to recover several groups?

There are 27 activities so 27 checkbox groups moreover these activities come from a bdd and the number can vary the construction of the form is done with a loop and variables




Aucun commentaire:

Enregistrer un commentaire