W3C HTML 4.01 Specification wrote: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. Note. Since existing implementations handle this case differently, the current specification differs from RFC 1866 ([RFC1866] section 188.8.131.52), which states:
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.
Since user agent behavior differs, authors should ensure that in each set of radio buttons that one is initially "on".
Albert Wiersch wrote:Would it have helped if CSE HTML Validator generated a warning for radio buttons with no default checked radio button? This sounds like a good check to add.
<input type="radio" name="sex" value="male" /> Male<br />
<input type="radio" name="sex" value="female" /> Female<br />
Users browsing this forum: No registered users and 0 guests