justravis Posted September 5, 2008 Share Posted September 5, 2008 Do people still use checkbox arrays? Validators seem to pick on them. Plus, how do you attach a label to 1 checkbox, when they are all named the same? Thanks! Quote Link to comment Share on other sites More sharing options...
lemmin Posted September 5, 2008 Share Posted September 5, 2008 I use checkbox arrays all the time. Give the checkbox an ID and use that with the for property of the label object: <input type="checkbox" name="chks[]" id="chk1"><label for="chk1">checkbox1</label> <input type="checkbox" name="chks[]" id="chk2"><label for="chk2">checkbox2</label> Quote Link to comment Share on other sites More sharing options...
haku Posted September 6, 2008 Share Posted September 6, 2008 As lemmin was saying, the 'for' attribute refers to the ID in the tag. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.