HTML Standard Tracker

Filter

File a bug

SVNBugCommentTime (UTC)
3822<select> examples2009-09-13 08:59
@@ -40230,20 +40230,59 @@ You cannot complete this form until the field is correct.</samp></pre>
   title="dom-cva-validationMessage">validationMessage</code>
   attributes, and the <code
   title="dom-cva-checkValidatity">checkValidity()</code> and <code
   title="dom-cva-setCustomValidity">setCustomValidity()</code>
   methods, are part of the <span>constraint validation API</span>. The
   <code title="dom-lfe-labels">labels</code> attribute provides a list
   of the element's <code>label</code>s.</p>
 
   </div>
 
+  <div class="example">
+
+   <p>The following example shows how a <code>select</code> element
+   can be used to offer the user with a set of options from which the
+   user can select a single option. The default option is
+   preselected</p>
+
+   <pre>&lt;p>
+ &lt;label for="unittype">Select unit type:&lt;/label>
+ &lt;select id="unittype" name="unittype">
+  &lt;option value="1"> Miner &lt;/option>
+  &lt;option value="2"> Puffer &lt;/option>
+  &lt;option value="3" selected> Snipey &lt;/option>
+  &lt;option value="4"> Max &lt;/option>
+  &lt;option value="5"> Firebot &lt;/option>
+ &lt;/select>
+&lt;/p></pre>
+
+  </div>
+
+  <div class="example">
+
+   <p>Here, the user is offered a set of options from which he can
+   select any number. By default, all five options are selected.</p>
+
+   <pre>&lt;p>
+ &lt;label for="allowedunits">Select unit types to enable on this map:&lt;/label>
+ &lt;select id="allowedunits" name="allowedunits" multiple>
+  &lt;option value="1" selected> Miner &lt;/option>
+  &lt;option value="2" selected> Puffer &lt;/option>
+  &lt;option value="3" selected> Snipey &lt;/option>
+  &lt;option value="4" selected> Max &lt;/option>
+  &lt;option value="5" selected> Firebot &lt;/option>
+ &lt;/select>
+&lt;/p></pre>
+
+  </div>
+
+
 
   <h4>The <dfn><code>datalist</code></dfn> element</h4>
 
   <dl class="element">
    <dt>Categories</dt>
    <dd><span>Flow content</span>.</dd>
    <dd><span>Phrasing content</span>.</dd>
    <dt>Contexts in which this element may be used:</dt>
    <dd>Where <span>phrasing content</span> is expected.</dd>
    <dt>Content model:</dt>

|