Why Checkboxe's name attribute must be the same?

Okay i get it,for radio boxes if all the related input elements have the same name attribute it leads user to check only one option.But what about checkboxes?Why all related checkbox inputs must have the same name attribute?

Sorry if this question is dumb :stuck_out_tongue: Thanks

giving a name to checkboxes means grouping them together to the same question

if you have 10 questions, and each has 5 checkboxes, and you don’t group them together, that would mean having 50 checkboxes lumped together - maybe you have also pretty similar values etc…

you give each checkboxes group a name that identify the question, so you know which checkboxes are for each question
and you may say that it’s visible in the page, yes, that’s true, but when the form is submitted, the data received on the other side will be names and values and not much else

1 Like