2

Quite often we allow to choose multiple items, this what are checkboxes are actually exist for. But in some scenarios something always had to be chosen.

For example, quite often user can have may roles assigned, but at least one role is obligatory.

The thing is that if we'll choose checkboxes as input source in that case, we'll to support quit bizarre behavior - a list of checkboxes, last selected of which can not be unselected.

This is quite contre-intuitive and not obvious at all.

So my question is - speaking of set of items, from which any combination can be chosen, but at least one - what is the best approach from interface point of view.

2 Answers 2

2

This is where validation comes into play. It's a tricky subject but almost every app of meaningful size has some kind of validation. In your case, I would recommend something like this.

mockup

download bmml source – Wireframes created with Balsamiq Mockups

If they then attempt to move on, save, navigate away or whatever else, you prevent them from doing so and show an error message something like this:

mockup

download bmml source

This way, the user will understand what they need to do because it will be clearly spelled out no matter what state they're in. Obviously, it would be ideal to come up with an innately intuitive way to express this to a user, but something like this is complex enough that some brief explanation coupled with your checkboxes is required.

Note that, in what I'm suggesting, you would not prevent them from unchecking all the boxes, but you would not allow them to progress until at least one is checked.

1
  • I personally like it when the application actually prevents me from going on in the 'must select one' case, usually by disabling whatever control is used to continue. Sep 4, 2014 at 17:46
2

... bizarre behavior - a list of checkboxes, last selected of which can not be unselected.

There is nothing stopping the user from unselecting all checkboxes, unless you force that situation. You shouldn't force that situation.

Going with the assumption that a confirmation action is required to commit the information, that action simply need not be available unless at least one checkbox is selected. Text instructing the user to have at least one option selected is not something that needs to be shunned.

For example, quite often user can have may roles assigned, but at least one role is obligatory.

If we continue with this example, in addition to possible solution described above...

One solution is to ask two questions:

  1. what is the user's primary role, giving them a drop down to select from.
  2. what additional roles do you want to assign to the user, giving them checkboxes.

mockup

download bmml source – Wireframes created with Balsamiq Mockups

Now there is always at least one role set, via the drop down.

Another possible solution is to have a minimum role that all users are a part of. Every user is simply part of the "user" group. This group is now hidden from the user and it is always assumed that they have at least a minimum set of privileges because a role is always assigned to them. The user does not have to know the complexity of groups happening in the background.

Checkboxes do not demand at least one be selected in the group. Forcing that condition, by preventing the user from de-selecting the last box, is actually what would be the counter-intuitive active.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.