RADIO button issues

According to HTML2.0/RFC1866, if the author does not explicitly "check" one of the buttons in a group of radio buttons, then the browser must "check" the first one: some browsers met this requirement, but many did not. The HTML3.2 recommendation seemed to have abandoned hope, since it said to authors: "one radio button in each group should be initially checked using the checked attribute". HTML4.0 did not address the issue directly, but in the HTML4.01 recommendation we now find an even-handed review of the requirements of HTML2.0 and the actual behaviour of browsers, HTML4.01 consequently ruling the behaviour to be "undefined" and, like HTML3.2, calling upon authors to ensure that in each set of radio buttons, one is explicitly "CHECKED".

There is a similar issue with the SELECT widget - see separate article. In both cases, it is wise when devising a form and its analysis script, to make sure they can cope with both kinds of browser response. Authors would be well advised to follow the advice to supply the "checked" attribute on one of the radio buttons (supplying an additional "no selection" button if the circumstances call for it), then their form will conform with all versions of HTML and be compatible with the various browser implementations. Partly this is a technical issue, and that's what's being discussed here. Partly there is also an etiquette issue, as there are many forms seen on the WWW that demand one of a fixed repertoire of answers, and leave the respondent no opportunity to withhold an answer or to indicate that none of the prepared responses is applicable: I know from anecdotal evidence that there are people who would otherwise have been willing to fill in a form, but who refuse to do so when they find they have no way of withholding certain answers.

There is no "checked" attribute on the following group of radio buttons, so this can test your browser for RFC1866 compliance. The submit button will submit the test to a reporting script.

one, two, three.

So much for the technical aspects of this problem. Coming back to this "etiquette" issue, there is sometimes a problem in that you would like to know for sure whether the user has really made a choice, or has omitted/withheld an answer. But you might not want to encourage them to withhold an answer by including a button that's boldly labelled for the purpose. Nevertheless, in order to make this work, you do really have to include that additional, initially checked, button in the form somehow.

One way of getting around that is to use the no-response button as a kind of bullet at the left of the question, something like this:

Please tell us whether you are Male, or Female.

Anything else I seem to have missed???

|Previous|Up| |RagBag|About the author|