Can you please let me know which way is the correct way of grouping the Name
attribute of a series of related checkboxes in together in HTML5? I have seen some tutorials on the web which are only using simple name as name="chk_group"
like below
<input type="checkbox" name="chk_group" value="value1" />Value 1<br />
<input type="checkbox" name="chk_group" value="value2" />Value 2<br />
<input type="checkbox" name="chk_group" value="value3" />Value 3<br />
how ever some people are using an array like name="chk_group[]"
<input type="checkbox" name="chk_group[]" value="value1" />Value 1<br />
<input type="checkbox" name="chk_group[]" value="value2" />Value 2<br />
<input type="checkbox" name="chk_group[]" value="value3" />Value 3<br />
can you please let me know what is the correct way in HTML5?
Thanks
Aucun commentaire:
Enregistrer un commentaire