Skip to content
Permalink
Browse files

[cgiow] (1) Make the label required if <select required> is used with…

…out multiple='' or size=''. Also, make it possible for the label to be disabled, for legacy UAs (new UAs wouldn't let the user select the label).

git-svn-id: http://svn.whatwg.org/webapps@6039 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Apr 28, 2011
1 parent d8d67d8 commit 92269e3f63abe6363bd40940e365f177ea97fa98
Showing with 38 additions and 19 deletions.
  1. +12 −6 complete.html
  2. +12 −6 index
  3. +14 −7 source

<p>If a <code><a href=#the-select-element>select</a></code> element has a <code title=attr-select-required><a href=#attr-select-required>required</a></code> attribute specified,
does not have a <code title=attr-select-multiple><a href=#attr-select-multiple>multiple</a></code>
attribute specified, and has a <a href=#concept-select-size title=concept-select-size>display size</a> of 1; and if the
<a href=#concept-option-value title=concept-option-value>value</a> of the first
<code><a href=#the-option-element>option</a></code> element in the <code><a href=#the-select-element>select</a></code> element's
<a href=#concept-select-option-list title=concept-select-option-list>list of options</a> (if
any) is the empty string, and that <code><a href=#the-option-element>option</a></code> is not <a href=#concept-option-disabled title=concept-option-disabled>disabled</a>, and, finally, that
attribute specified, and has a <a href=#concept-select-size title=concept-select-size>display size</a> of 1;
and if the <a href=#concept-option-value title=concept-option-value>value</a> of the
first <code><a href=#the-option-element>option</a></code> element in the <code><a href=#the-select-element>select</a></code>
element's <a href=#concept-select-option-list title=concept-select-option-list>list of
options</a> (if any) is the empty string, and that
<code><a href=#the-option-element>option</a></code> element's parent node is the <code><a href=#the-select-element>select</a></code>
element (and not an <code><a href=#the-optgroup-element>optgroup</a></code> element), then that
<code><a href=#the-option-element>option</a></code> is the <code><a href=#the-select-element>select</a></code> element's
<dfn id=placeholder-label-option>placeholder label option</dfn>.</p>

<p>If a <code><a href=#the-select-element>select</a></code> element has a <code title=attr-select-required><a href=#attr-select-required>required</a></code> attribute specified,
does not have a <code title=attr-select-multiple><a href=#attr-select-multiple>multiple</a></code>
attribute specified, and has a <a href=#concept-select-size title=concept-select-size>display size</a> of 1,
then the <code><a href=#the-select-element>select</a></code> element must have a <a href=#placeholder-label-option>placeholder
label option</a>.</p>

<div class=impl>

<p><strong>Constraint validation</strong>: If the element has its
the <code><a href=#the-select-element>select</a></code> element's <a href=#concept-select-option-list title=concept-select-option-list>list of options</a> have their
<a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> set to
true, or the only <code><a href=#the-option-element>option</a></code> element in the
<code>selected</code> element's <a href=#concept-select-option-list title=concept-select-option-list>list of options</a> with its
<code><a href=#the-select-element>select</a></code> element's <a href=#concept-select-option-list title=concept-select-option-list>list of options</a> with its
<a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> set to
true is the <a href=#placeholder-label-option>placeholder label option</a>, then the element
is <a href=#suffering-from-being-missing>suffering from being missing</a>.</p>
18 index

<p>If a <code><a href=#the-select-element>select</a></code> element has a <code title=attr-select-required><a href=#attr-select-required>required</a></code> attribute specified,
does not have a <code title=attr-select-multiple><a href=#attr-select-multiple>multiple</a></code>
attribute specified, and has a <a href=#concept-select-size title=concept-select-size>display size</a> of 1; and if the
<a href=#concept-option-value title=concept-option-value>value</a> of the first
<code><a href=#the-option-element>option</a></code> element in the <code><a href=#the-select-element>select</a></code> element's
<a href=#concept-select-option-list title=concept-select-option-list>list of options</a> (if
any) is the empty string, and that <code><a href=#the-option-element>option</a></code> is not <a href=#concept-option-disabled title=concept-option-disabled>disabled</a>, and, finally, that
attribute specified, and has a <a href=#concept-select-size title=concept-select-size>display size</a> of 1;
and if the <a href=#concept-option-value title=concept-option-value>value</a> of the
first <code><a href=#the-option-element>option</a></code> element in the <code><a href=#the-select-element>select</a></code>
element's <a href=#concept-select-option-list title=concept-select-option-list>list of
options</a> (if any) is the empty string, and that
<code><a href=#the-option-element>option</a></code> element's parent node is the <code><a href=#the-select-element>select</a></code>
element (and not an <code><a href=#the-optgroup-element>optgroup</a></code> element), then that
<code><a href=#the-option-element>option</a></code> is the <code><a href=#the-select-element>select</a></code> element's
<dfn id=placeholder-label-option>placeholder label option</dfn>.</p>

<p>If a <code><a href=#the-select-element>select</a></code> element has a <code title=attr-select-required><a href=#attr-select-required>required</a></code> attribute specified,
does not have a <code title=attr-select-multiple><a href=#attr-select-multiple>multiple</a></code>
attribute specified, and has a <a href=#concept-select-size title=concept-select-size>display size</a> of 1,
then the <code><a href=#the-select-element>select</a></code> element must have a <a href=#placeholder-label-option>placeholder
label option</a>.</p>

<div class=impl>

<p><strong>Constraint validation</strong>: If the element has its
the <code><a href=#the-select-element>select</a></code> element's <a href=#concept-select-option-list title=concept-select-option-list>list of options</a> have their
<a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> set to
true, or the only <code><a href=#the-option-element>option</a></code> element in the
<code>selected</code> element's <a href=#concept-select-option-list title=concept-select-option-list>list of options</a> with its
<code><a href=#the-select-element>select</a></code> element's <a href=#concept-select-option-list title=concept-select-option-list>list of options</a> with its
<a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> set to
true is the <a href=#placeholder-label-option>placeholder label option</a>, then the element
is <a href=#suffering-from-being-missing>suffering from being missing</a>.</p>
21 source
title="attr-select-required">required</code> attribute specified,
does not have a <code title="attr-select-multiple">multiple</code>
attribute specified, and has a <span
title="concept-select-size">display size</span> of 1; and if the
<span title="concept-option-value">value</span> of the first
<code>option</code> element in the <code>select</code> element's
<span title="concept-select-option-list">list of options</span> (if
any) is the empty string, and that <code>option</code> is not <span
title="concept-option-disabled">disabled</span>, and, finally, that
title="concept-select-size">display size</span> of 1;
and if the <span title="concept-option-value">value</span> of the
first <code>option</code> element in the <code>select</code>
element's <span title="concept-select-option-list">list of
options</span> (if any) is the empty string, and that
<code>option</code> element's parent node is the <code>select</code>
element (and not an <code>optgroup</code> element), then that
<code>option</code> is the <code>select</code> element's
<dfn>placeholder label option</dfn>.</p>

<p>If a <code>select</code> element has a <code
title="attr-select-required">required</code> attribute specified,
does not have a <code title="attr-select-multiple">multiple</code>
attribute specified, and has a <span
title="concept-select-size">display size</span> of 1,
then the <code>select</code> element must have a <span>placeholder
label option</span>.</p>

<div class="impl">

<p><strong>Constraint validation</strong>: If the element has its
title="concept-select-option-list">list of options</span> have their
<span title="concept-option-selectedness">selectedness</span> set to
true, or the only <code>option</code> element in the
<code>selected</code> element's <span
<code>select</code> element's <span
title="concept-select-option-list">list of options</span> with its
<span title="concept-option-selectedness">selectedness</span> set to
true is the <span>placeholder label option</span>, then the element

0 comments on commit 92269e3

Please sign in to comment.
You can’t perform that action at this time.