How to make a checkbox behave like a radio button

Solution


Glad we could help.
Just because it can be done, does not always mean it should be done.

Tread lightly, though, when telling the boss 'No".

USAFRet

Illustrious
Moderator
Simple answer - You don't.

You're going against the first rule of interface design - 'Do not confuse the user'

A checkbox has a certain expected functionality. The user would expect to be able to select one or more checkboxes.

A radio button has a different expected functionality. You may select one and only one.

Changing those around would lead a user to think something is broken, because every other checkbox he has ever encountered works the same way, except yours.

If you want radio button functionality (one and only one selection), then use a radio button.
 

randomizer

Distinguished
You could do it with JavaScript, but as USAFRet said you just shouldn't. I have seen this done on a few websites by large companies. It boggles the mind that they would waste time writing JavaScript to toggle checkboxes on and off and totally confuse users, when radio buttons do precisely the same thing and everybody expects them to.
 

USAFRet

Illustrious
Moderator


Glad we could help.
Just because it can be done, does not always mean it should be done.

Tread lightly, though, when telling the boss 'No".
 
Solution