- πΊπΈUnited States smustgrave
Currently going through the end of the queue to see what could still be relevant for D10.
Wonder if this is still needed for D10?
Spill-over from #569542: Button Option Field is Required, has One Option - Select that Option β and #368771-24: Create Documentation about removing N/A option for not required radio buttons β :
From http://www.w3.org/TR/html401/interact/forms.html#h-17.2.1 (I tried to find an XHTML version of this section, and failed):
If no radio button in a set sharing the same control name is initially "on", user agent behavior for choosing which control is initially "on" is undefined. [snip] Since user agent behavior differs, authors should ensure that in each set of radio buttons that one is initially "on".
See also http://www.ietf.org/rfc/rfc1866.txt
The recommendation is basically saying that there should never be a situation where radio buttons appear that do not have one of the options pre-selected. Mainly, I guess, because you can never "un" select one of the options in a list of radios once you click into it. If you want a control where users have to explicitly choose something, you should use a select box instead which can have a 'neutral' option.
What CCK (and presumably Field UI) does is, for required fields, always select the first one in the list. For non-required fields, it automatically creates an "N/A" option to give people the ability to not fill out the field.
Basically, I guess the question is... should Form API enforce this recommendation, and disallow radio button controls without a #default_value (probably defaulting to the first option if none is selected)? People who still wanted "N/A" as one of the choices could still add it in there as one of the $options.
Anyone here web a standards geek?
Postponed: needs info
9.5
Last updated
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Currently going through the end of the queue to see what could still be relevant for D10.
Wonder if this is still needed for D10?