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.
Radio buttons are basically used for the single selection from multiple ones, which is mostly used in GUI forms. You can mark/check only one radio button between two or more radio buttons.
Always Offer a Default Selection This means enabling people to set a UI control back to its original state. In case of radio buttons this means that radio buttons should always have exactly one option pre-selected. Select the safest and most secure option (to prevent data loss).
You can check a radio button by default by adding the checked HTML attribute to the <input> element. You can disable a radio button by adding the disabled HTML attribute to both the <label> and the <input> .
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).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With