- From: Ian Hickson via cvs-syncmail <cvsmail@w3.org>
- Date: Thu, 14 Oct 2010 07:40:28 +0000
- To: public-html-commits@w3.org
Update of /sources/public/html5/spec
In directory hutz:/tmp/cvs-serv15345
Modified Files:
Overview.html
Log Message:
new example of nested disabled fieldsets (whatwg r5621)
Index: Overview.html
===================================================================
RCS file: /sources/public/html5/spec/Overview.html,v
retrieving revision 1.4496
retrieving revision 1.4497
diff -u -d -r1.4496 -r1.4497
--- Overview.html 13 Oct 2010 20:19:05 -0000 1.4496
+++ Overview.html 14 Oct 2010 07:40:25 -0000 1.4497
@@ -27678,6 +27678,41 @@
<p><label>Expiry date: <input name=clubexp type=month></label></p>
</fieldset></pre>
+ </div><div class="example">
+
+ <p>You can also nest <code><a href="#the-fieldset-element">fieldset</a></code> elements. Here is an
+ example expanding on the previous one that does so:</p>
+
+ <pre><fieldset name="clubfields" disabled>
+ <legend> <label>
+ <input type=checkbox name=club onchange="form.clubfields.disabled = !checked">
+ Use Club Card
+ </label> </legend>
+ <p><label>Name on card: <input name=clubname required></label></p>
+ <fieldset name="numfields">
+ <legend> <label>
+ <input type=radio checked name=clubtype onchange="form.numfields.disabled = !checked">
+ My card has numbers on it
+ </label> </legend>
+ <p><label>Card number: <input name=clubnum required pattern="[-0-9]+"></label></p>
+ </fieldset>
+ <fieldset name="letfields" disabled>
+ <legend> <label>
+ <input type=radio name=clubtype onchange="form.letfields.disabled = !checked">
+ My card has letters on it
+ </label> </legend>
+ <p><label>Card code: <input name=clublet required pattern="[A-Za-z]+"></label></p>
+ </fieldset>
+</fieldset></pre>
+
+ <p>In this example, if the outer "Use Club Card" checkbox is not
+ checked, everything inside the outer <code><a href="#the-fieldset-element">fieldset</a></code>,
+ including the two radio buttons in the legends of the two nested
+ <code><a href="#the-fieldset-element">fieldset</a></code>s, will be disabled. However, if the checkbox
+ is checked, then the radio buttons will both be enabled and will
+ let you select which of the two inner <code><a href="#the-fieldset-element">fieldset</a></code>s is to
+ be enabled.</p>
+
</div><h4 id="the-legend-element"><span class="secno">4.10.5 </span>The <dfn><code>legend</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
<dd>None.</dd>
<dt>Contexts in which this element can be used:</dt>
Received on Thursday, 14 October 2010 07:40:30 UTC