Pedantic Forms Test
In the HTML 2.0 spec, section 8.1.2.4 explicitly states that:
At all times, exactly one of the radio buttons in a set is checked. If
none of the INPUT elements of a set of radio buttons specifies
`CHECKED', then the user agent must check the first radio button of
the set initially.
Note however that at least Netscape 2.0 ignores this, so that if no
radio buttons in an array are CHECKED
, as in this form:
initially none of the radio buttons will be selected. I happen to
think the spec is correct, and HTML authors that rely on this feature
are writing bad surveys. The reason is that as currently implemented,
once a radio is selected it can never be unselected unless the entire
form is reset. To me, this violates the principle of least surprise.
HTML authors should, in these cases, include a None of the
Above or Other radio and have this be the default
checked choice, like so:
But oh well, since the other browsers do it this way, Grail now
exhibits this behavior by default. It's more fun to be pedantic
though, so the undocumented parsing-html--strict
preference, when set, will force Grail to conform to the spec as
written.
Grail now exhibits the following behavior, which is identical to
what Netscape 2.0 exhibits:
- Initially no radios in the array are selected
- Once a radio has been selected, there's no way to just unselected
it, short of resetting the entire form.
- Upon `reload' of the page, any selected radio stays selected.
reload does *not* reset the radio. Note that Microsoft Internet
Explorer 2.0 does reset the radio to none-selected upon page
reload. So who's broken behavior should Grail mimic, hmm?
- Using the form's reset button, all radios are unselected.