Should One HTML Radio Button In a Radio Group Always Be Checked?
Asked Answered
K

5

6

Are there any standards (HTML, UI, accessibility, and such like) that stipulate that one of the radio buttons in a given group of radio buttons should be selected at all times?

I have encountered a business requirement whereby I have been asked that both radio buttons in a group be left unchecked, and then to have logic forcing the user to select one before they can continue.

While I know how to achieve this, it felt wrong, and I intimated as such, but was looking for guidelines that stipulate this more explicitly so I can feed this into our own standards.

Kramer answered 11/8, 2010 at 9:33 Comment(0)
C
13

Yes: http://www.w3.org/TR/html401/interact/forms.html#radio

At all times, exactly one of the radio buttons in a set is checked. If none of the elements of a set of radio buttons specifies `CHECKED', then the user agent must check the first radio button of the set initially.

The specification uses the term "user agent" for what is commonly known as "browser". So the specification says that if none is checked, the browser will check the first.

UPDATE: note that none of the 4 Browsers i tried actually does this! They dont check the first and none of the radios are given as =on to the server. A good web framework should do the serverside-checking (it should do it anyway because an abrupted or forged POST could cause the same).

Constitutive answered 11/8, 2010 at 9:47 Comment(1)
Short and to the point, but exactly what I was after. Accepted answer because it links to the formal standard, which I can reference. Apologies to everyone else, though all helpful are voted up.Kramer
B
5

I was going to say I read something in the past by Jakob Neilson, but heck, I found it: PS. personally I ALWAYS have one selected by default, and so for select boxes, but what happens is in legal terms and conditions, lawyers are afraaaaid, of course, you feed the cat to your dog you will always be afraid of the kittens :

Always offer a default selection for radio button lists. By definition, radio buttons always have exactly one option selected, and you therefore shouldn't display them without a default selection. (Checkboxes, in contrast, often default to having none of the options selected.) ◦If users might need to refrain from making a selection, you should provide a radio button for this choice, such as one labeled "None." Offering users an explicit, neutral option to click is better than requiring the implicit act of not selecting from the list, especially because

http://www.useit.com/alertbox/20040927.html

Bibliophile answered 11/8, 2010 at 9:48 Comment(0)
U
5

Standards don't always make sense

If you follow the standard (which is what Neilson does) that as other answers state - than one radio button should always be checked.

But if you follow common sense, and design for use cases than the answer is clearly not. For god knows what reason the standard completely neglects a very popular use case:

The user shall make an exclusive choice, but no default shall exist.

Perhaps a prime example for this is likert scales - any default will prime participants:

A likert survery

A modern language example

How would you translate to an interface the following question:

Would you like tea or coffee?

The standard forces you to ask it this way:

Would you like tea or coffee? I believe it's tea that you want.

And so no one comply with them

It is exactly because the standard doesn't account for such cases (and the lack of usability in alternatives, like comboboxes with a blank option) that no browser comply with the standard - Imagine Google Forms with radio buttons having a default.

Upland answered 13/11, 2014 at 12:17 Comment(1)
I agree that there are times when not having a default option makes sense, but I don't know that a Likert scale is actually a good example. It would make as much 'common sense' to have the 'neutral' option be selected in each case by default. (I'll save a debate on how usable Likert scales are to use in general for another day :)Cnut
M
2

Anytime you're overriding a default browser behaviour you're creating uncertainty for the user. Furthermore, on average, when there are two options there is a 50% chance that the pre-selected one will be correct. Forcing the user to select it just slows them down on the assumption they're either blind or clueless.

I would personally find the concept insulting - but then I'm not a manager.

Moorehead answered 11/8, 2010 at 9:46 Comment(2)
think of it this way: male, female, at least 50% of your audience dont have to click... :)Bibliophile
And the other 50% will be annoyed that the other option is considered the default. (I follow the general argument, but there are sticky issues that need resolving in the relevant problem domain."Midgett
S
0

One good example is when you have a webshop and want the customer to make an active choice instead of letting some orders through where the customer just clicked on add to cart without choosing any size and therefore get the size that is pre selected.

Am I wrong?

Swec answered 2/12, 2014 at 17:38 Comment(1)
That's why we use select menus for sizes, not radios.Sproul

© 2022 - 2024 — McMap. All rights reserved.