Skip to content
Permalink
Browse files

[] (0) WF2: required constraint.

git-svn-id: http://svn.whatwg.org/webapps@2273 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information...
Hixie committed Oct 3, 2008
1 parent 27daf51 commit 64a8bdf179983ef328560bbb8a7ee42b8f7008a9
Showing with 77 additions and 23 deletions.
  1. +36 −13 index
  2. +41 −10 source
49 index

<p>For example, on platforms where clicking a checkbox label checks
the checkbox, clicking the <code><a href=#the-label-element>label</a></code> in the following
snippet could trigger the user agent to <span>run synthetic click
activation steps on the <code><a href=#the-input-element>input</a></code> element, as if
the element itself had been triggered by the user:</span></p>
snippet could trigger the user agent to <a href=#run-synthetic-click-activation-steps>run synthetic click
activation steps</a> on the <code><a href=#the-input-element>input</a></code> element, as if
the element itself had been triggered by the user:</p>

<pre>&lt;label&gt;&lt;input type=checkbox name=lost&gt; Lost&lt;/label&gt;</pre>

<!-- <td class="yes"> Yes Time -->
<td class=yes> Yes <!-- Local Date and Time -->
<!-- <td class="yes"> Yes Number -->
<td class=yes> Yes <!-- Range -->
<td class=no> &middot; <!-- Range -->
<td class=yes> Yes <!-- Checkbox -->
<!-- <td class="yes"> Yes Radio Button -->
<td class=yes> Yes <!-- File -->
serialisation. e.g. should it be 2008-01-01T00:00 or
2008-01-01t00:00? should it be 1e2 or 100? -->

<!-- XXX for each of these, need to say when to fire oninput,
onchange, and when required='' is satisfied -->
<!-- XXX for each of these, need to say when to fire oninput and
onchange -->



<code title=attr-input-autocomplete><a href=#attr-input-autocomplete>autocomplete</a></code>,
<code title=attr-input-list><a href=#attr-input-list>list</a></code>,
<code title=attr-input-max><a href=#attr-input-max>max</a></code>,
<code title=attr-input-min><a href=#attr-input-min>min</a></code>,
<code title=attr-input-required><a href=#attr-input-required>required</a></code>, and
<code title=attr-input-min><a href=#attr-input-min>min</a></code>, and
<code title=attr-input-step><a href=#attr-input-step>step</a></code> content attributes;
<code title=dom-input-list><a href=#dom-input-list>list</a></code>,
<code title=dom-input-value><a href=#dom-input-value>value</a></code>,
<code class=no-backref title=attr-fs-method><a href=#attr-fs-method>method</a></code>,
<code class=no-backref title=attr-input-pattern><a href=#attr-input-pattern>pattern</a></code>,
<code class=no-backref title=attr-input-readonly><a href=#attr-input-readonly>readonly</a></code>,
<code class=no-backref title=attr-input-required><a href=#attr-input-required>required</a></code>,
<code class=no-backref title=attr-input-size><a href=#attr-input-size>size</a></code>,
<code class=no-backref title=attr-input-src><a href=#attr-input-src>src</a></code>, and
<code class=no-backref title=attr-fs-target><a href=#attr-fs-target>target</a></code>.</p>
<p>If the element is <i title=concept-input-mutable><a href=#concept-input-mutable>mutable</a></i>,
the user should allow the user to toggle the <a href=#concept-fe-checked title=concept-fe-checked>checkedness</a> state.</p>

<!-- XXX event timing; acivation behavior -->
<p><strong>Constraint validation:</strong> If the element is <i title=concept-input-required><a href=#concept-input-required>required</a></i> and its <span title=concept-fe-checkedness>checkedness</span> is false, then the
element is <a href=#suffering-from-being-missing>suffering from being missing</a>.</p>

<!-- XXX event timing; activation behavior -->

<p><strong>The <a href=#value-sanitization-algorithm>value sanitization algorithm</a> is as
follows:</strong> Do nothing.</p>
the user should allow the user to set the <a href=#concept-fe-checked title=concept-fe-checked>checkedness</a> state of the
element to true.</p>

<!-- XXX event timing; acivation behavior -->

<p>When any of the following events occur, if the element's <a href=#concept-fe-checked title=concept-fe-checked>checkedness</a> state is true after
the event, the <a href=#concept-fe-checked title=concept-fe-checked>checkedness</a> state of all the
other elements in the same <i><a href=#radio-button-group>radio button group</a></i> must be set to

<li>The element's <a href=#form-owner>form owner</a> changes.</li>

</ul><p><strong>The <a href=#value-sanitization-algorithm>value sanitization algorithm</a> is as
</ul><p><strong>Constraint validation:</strong> If the element is <i title=concept-input-required><a href=#concept-input-required>required</a></i> and all of the
<code><a href=#the-input-element>input</a></code> elements in the <i><a href=#radio-button-group>radio button group</a></i> have a
<span title=concept-fe-checkedness>checkedness</span> that is
false, then the element is <a href=#suffering-from-being-missing>suffering from being
missing</a>.</p>

<!-- XXX event timing; activation behavior -->

<p><strong>The <a href=#value-sanitization-algorithm>value sanitization algorithm</a> is as
follows:</strong> Do nothing.</p>

<p>The following common <code><a href=#the-input-element>input</a></code> element content

<p class=XXX>... list of <dfn id=concept-input-type-file-selected title=concept-input-type-file-selected>selected files</dfn></p>

<p><strong>Constraint validation:</strong> If the element is <i title=concept-input-required><a href=#concept-input-required>required</a></i> and the list of <a href=#concept-input-type-file-selected title=concept-input-type-file-selected>selected files</a> is
empty, then the element is <a href=#suffering-from-being-missing>suffering from being
missing</a>.</p>



<h6 id=submit-button-state><span class=secno>4.10.4.1.17 </span><dfn title=attr-input-type-submit>Submit Button</dfn> state</h6>

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

<p class=XXX>... <dfn id=attr-input-required title=attr-input-required><code>required</code></dfn></p>
<p>The <dfn id=attr-input-required title=attr-input-required><code>required</code></dfn>
attribute is a <a href=#boolean-attribute>boolean attribute</a>. When specified, the
element is <dfn id=concept-input-required title=concept-input-required><i>required</i></dfn>.</p>

<p><strong>Constraint validation:</strong> If the element is <i title=concept-input-required><a href=#concept-input-required>required</a></i>, and its <code title=dom-input-value><a href=#dom-input-value>value</a></code> DOM attribute applies and is in
the mode <a href=#dom-input-value-value title=dom-input-value-value>value</a>, and the
element's <a href=#concept-fe-value title=concept-fe-value>value</a> is the empty
string, then the element is <a href=#suffering-from-being-missing>suffering from being
missing</a>.</p>




<p class=XXX>An element <dfn id=concept-fv-valid title=concept-fv-valid>satisfies its constraints</dfn> if ...</p>

<p class=XXX>... <dfn id=suffering-from-being-missing>suffering from being missing</dfn></p>

<p class=XXX>... <dfn id=suffering-from-a-type-mismatch>suffering from a type
mismatch</dfn></p>

51 source
<p>For example, on platforms where clicking a checkbox label checks
the checkbox, clicking the <code>label</code> in the following
snippet could trigger the user agent to <span>run synthetic click
activation steps</psna> on the <code>input</code> element, as if
activation steps</span> on the <code>input</code> element, as if
the element itself had been triggered by the user:</p>

<pre>&lt;label>&lt;input type=checkbox name=lost> Lost&lt;/label></pre>
<!-- <td class="yes"> Yes Time -->
<td class="yes"> Yes <!-- Local Date and Time -->
<!-- <td class="yes"> Yes Number -->
<td class="yes"> Yes <!-- Range -->
<td class="no"> &middot; <!-- Range -->
<td class="yes"> Yes <!-- Checkbox -->
<!-- <td class="yes"> Yes Radio Button -->
<td class="yes"> Yes <!-- File -->
serialisation. e.g. should it be 2008-01-01T00:00 or
2008-01-01t00:00? should it be 1e2 or 100? -->

<!-- XXX for each of these, need to say when to fire oninput,
onchange, and when required='' is satisfied -->
<!-- XXX for each of these, need to say when to fire oninput and
onchange -->



<code title="attr-input-autocomplete">autocomplete</code>,
<code title="attr-input-list">list</code>,
<code title="attr-input-max">max</code>,
<code title="attr-input-min">min</code>,
<code title="attr-input-required">required</code>, and
<code title="attr-input-min">min</code>, and
<code title="attr-input-step">step</code> content attributes;
<code title="dom-input-list">list</code>,
<code title="dom-input-value">value</code>,
<code class="no-backref" title="attr-fs-method">method</code>,
<code class="no-backref" title="attr-input-pattern">pattern</code>,
<code class="no-backref" title="attr-input-readonly">readonly</code>,
<code class="no-backref" title="attr-input-required">required</code>,
<code class="no-backref" title="attr-input-size">size</code>,
<code class="no-backref" title="attr-input-src">src</code>, and
<code class="no-backref" title="attr-fs-target">target</code>.</p>
the user should allow the user to toggle the <span
title="concept-fe-checked">checkedness</span> state.</p>

<!-- XXX event timing; acivation behavior -->
<p><strong>Constraint validation:</strong> If the element is <i
title="concept-input-required">required</i> and its <span
title="concept-fe-checkedness">checkedness</span> is false, then the
element is <span>suffering from being missing</span>.</p>

<!-- XXX event timing; activation behavior -->

<p><strong>The <span>value sanitization algorithm</span> is as
follows:</strong> Do nothing.</p>
title="concept-fe-checked">checkedness</span> state of the
element to true.</p>

<!-- XXX event timing; acivation behavior -->

<p>When any of the following events occur, if the element's <span
title="concept-fe-checked">checkedness</span> state is true after
the event, the <span

</ul>

<p><strong>Constraint validation:</strong> If the element is <i
title="concept-input-required">required</i> and all of the
<code>input</code> elements in the <i>radio button group</i> have a
<span title="concept-fe-checkedness">checkedness</span> that is
false, then the element is <span>suffering from being
missing</span>.</p>

<!-- XXX event timing; activation behavior -->

<p><strong>The <span>value sanitization algorithm</span> is as
follows:</strong> Do nothing.</p>


<p class="XXX">... list of <dfn title="concept-input-type-file-selected">selected files</dfn></p>

<p><strong>Constraint validation:</strong> If the element is <i
title="concept-input-required">required</i> and the list of <span
title="concept-input-type-file-selected">selected files</span> is
empty, then the element is <span>suffering from being
missing</span>.</p>



<h6><dfn title="attr-input-type-submit">Submit Button</dfn> state</h6>

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

<p class="XXX">... <dfn title="attr-input-required"><code>required</code></dfn></p>
<p>The <dfn title="attr-input-required"><code>required</code></dfn>
attribute is a <span>boolean attribute</span>. When specified, the
element is <dfn
title="concept-input-required"><i>required</i></dfn>.</p>

<p><strong>Constraint validation:</strong> If the element is <i
title="concept-input-required">required</i>, and its <code
title="dom-input-value">value</code> DOM attribute applies and is in
the mode <span title="dom-input-value-value">value</span>, and the
element's <span title="concept-fe-value">value</span> is the empty
string, then the element is <span>suffering from being
missing</span>.</p>



<p class="XXX">An element <dfn
title="concept-fv-valid">satisfies its constraints</dfn> if ...</p>

<p class="XXX">... <dfn>suffering from being missing</dfn></p>

<p class="XXX">... <dfn>suffering from a type
mismatch</dfn></p>

0 comments on commit 64a8bdf

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