HTML HTML Forms Choosing Options Checkboxes

3lg3
3lg3
8,204 Points

Multiple selections vs. limited/single selections

In the Radio Button section we learned that when the 'name' attributes are the same, you get single selection scenario (i.e. can select one or the other option, but not multiple selections).

Now in the Check Box section, the 'name' attributes are the same, yet I can select (check) all that apply (i.e. can have multiple selections). It seems to work when the 'name' attributes are the same and when they're modified.

Is this due to 'checkbox' behavior?

In other words, use radio buttons when you may want to control the selection options (1 or multi) and use checkboxes when you don't want to limit the number of selections a user can make?

3lg3
3lg3
8,204 Points

actually...just rewatched the lesson and yes that is why you want to use check boxes. (must get more sleep)

1 Answer

Steven Parker
Steven Parker
158,708 Points

You're exactly right.

This also makes the UX more familiar to most users, as they will expect radio button behavior to be exclusive but check-boxes to work independently.