Skip to content

Commit

Permalink
[e] (0) Add an example of radio buttons.
Browse files Browse the repository at this point in the history
Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=16029
Affected topics: HTML

git-svn-id: http://svn.whatwg.org/webapps@8028 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Jul 3, 2013
1 parent 03101fe commit f90ed8c
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 0 deletions.
24 changes: 24 additions & 0 deletions complete.html
Expand Up @@ -49883,6 +49883,30 @@ <h6 id=the-required-attribute><span class=secno>4.10.7.3.4 </span>The <code titl

</div>

<div class=example>

<p>For radio buttons, the <code title=attr-input-required><a href=#attr-input-required>required</a></code> attribute is
satisfied if any of the radio buttons in the <a href=#radio-button-group title="radio button group">group</a> is
selected. Thus, in the following example, any of the radio buttons can be checked, not just the
one marked as required:</p>

<pre>&lt;fieldset&gt;
&lt;legend&gt;Did the movie pass the Bechdel test?&lt;/legend&gt;
&lt;p&gt;&lt;label&gt;&lt;input type="radio" name="bechdel" value="no-characters"&gt; No, there are not even two female characters in the movie. &lt;/label&gt;
&lt;p&gt;&lt;label&gt;&lt;input type="radio" name="bechdel" value="no-names"&gt; No, the female characters never talk to each other. &lt;/label&gt;
&lt;p&gt;&lt;label&gt;&lt;input type="radio" name="bechdel" value="no-topic"&gt; No, when female characters talk to each other it's always about a male character. &lt;/label&gt;
&lt;p&gt;&lt;label&gt;&lt;input type="radio" name="bechdel" value="yes" <strong>required</strong>&gt; Yes. &lt;/label&gt;
&lt;p&gt;&lt;label&gt;&lt;input type="radio" name="bechdel" value="unknown"&gt; I don't know. &lt;/label&gt;
&lt;/fieldset&gt;</pre>

<p>To avoid confusion as to whether a <a href=#radio-button-group>radio button group</a> is required or not, authors
are encouraged to specify the attribute on all the radio buttons in a group. Indeed, in general,
authors are encouraged to avoid having radio button groups that do not have any initially checked
controls in the first place, as this is a state that the user cannot return to, and is therefore
generally considered a poor user interface.</p>

</div>


<h6 id=the-multiple-attribute><span class=secno>4.10.7.3.5 </span>The <code title=attr-input-multiple><a href=#attr-input-multiple>multiple</a></code> attribute</h6>

Expand Down
24 changes: 24 additions & 0 deletions index
Expand Up @@ -49883,6 +49883,30 @@ ldh-str = &lt; as defined in <a href=http://tools.ietf.org/html/rfc1034#se

</div>

<div class=example>

<p>For radio buttons, the <code title=attr-input-required><a href=#attr-input-required>required</a></code> attribute is
satisfied if any of the radio buttons in the <a href=#radio-button-group title="radio button group">group</a> is
selected. Thus, in the following example, any of the radio buttons can be checked, not just the
one marked as required:</p>

<pre>&lt;fieldset&gt;
&lt;legend&gt;Did the movie pass the Bechdel test?&lt;/legend&gt;
&lt;p&gt;&lt;label&gt;&lt;input type="radio" name="bechdel" value="no-characters"&gt; No, there are not even two female characters in the movie. &lt;/label&gt;
&lt;p&gt;&lt;label&gt;&lt;input type="radio" name="bechdel" value="no-names"&gt; No, the female characters never talk to each other. &lt;/label&gt;
&lt;p&gt;&lt;label&gt;&lt;input type="radio" name="bechdel" value="no-topic"&gt; No, when female characters talk to each other it's always about a male character. &lt;/label&gt;
&lt;p&gt;&lt;label&gt;&lt;input type="radio" name="bechdel" value="yes" <strong>required</strong>&gt; Yes. &lt;/label&gt;
&lt;p&gt;&lt;label&gt;&lt;input type="radio" name="bechdel" value="unknown"&gt; I don't know. &lt;/label&gt;
&lt;/fieldset&gt;</pre>

<p>To avoid confusion as to whether a <a href=#radio-button-group>radio button group</a> is required or not, authors
are encouraged to specify the attribute on all the radio buttons in a group. Indeed, in general,
authors are encouraged to avoid having radio button groups that do not have any initially checked
controls in the first place, as this is a state that the user cannot return to, and is therefore
generally considered a poor user interface.</p>

</div>


<h6 id=the-multiple-attribute><span class=secno>4.10.7.3.5 </span>The <code title=attr-input-multiple><a href=#attr-input-multiple>multiple</a></code> attribute</h6>

Expand Down
24 changes: 24 additions & 0 deletions source
Expand Up @@ -54672,6 +54672,30 @@ ldh-str = &lt; as defined in <a href="http://tools.ietf.org/html/rfc1034#s

</div>

<div class="example">

<p>For radio buttons, the <code title="attr-input-required">required</code> attribute is
satisfied if any of the radio buttons in the <span title="radio button group">group</span> is
selected. Thus, in the following example, any of the radio buttons can be checked, not just the
one marked as required:</p>

<pre>&lt;fieldset>
&lt;legend>Did the movie pass the Bechdel test?&lt;/legend>
&lt;p>&lt;label>&lt;input type="radio" name="bechdel" value="no-characters"> No, there are not even two female characters in the movie. &lt;/label>
&lt;p>&lt;label>&lt;input type="radio" name="bechdel" value="no-names"> No, the female characters never talk to each other. &lt;/label>
&lt;p>&lt;label>&lt;input type="radio" name="bechdel" value="no-topic"> No, when female characters talk to each other it's always about a male character. &lt;/label>
&lt;p>&lt;label>&lt;input type="radio" name="bechdel" value="yes" <strong>required</strong>> Yes. &lt;/label>
&lt;p>&lt;label>&lt;input type="radio" name="bechdel" value="unknown"> I don't know. &lt;/label>
&lt;/fieldset></pre>

<p>To avoid confusion as to whether a <span>radio button group</span> is required or not, authors
are encouraged to specify the attribute on all the radio buttons in a group. Indeed, in general,
authors are encouraged to avoid having radio button groups that do not have any initially checked
controls in the first place, as this is a state that the user cannot return to, and is therefore
generally considered a poor user interface.</p>

</div>


<h6>The <code title="attr-input-multiple">multiple</code> attribute</h6>

Expand Down

0 comments on commit f90ed8c

Please sign in to comment.