Skip to content
Permalink
Browse files

[giow] (2) Define 'button' and 'default button' and define implicit f…

…orm submission.

git-svn-id: http://svn.whatwg.org/webapps@2379 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Oct 29, 2008
1 parent 518263f commit b9facb3316d223a6f68846cc439ca9143b9680ed
Showing with 108 additions and 21 deletions.
  1. +55 −13 index
  2. +53 −8 source
68 index
@@ -559,9 +559,11 @@
<li><a href=#security-0><span class=secno>4.10.14.4 </span>Security</a></ol></li>
<li><a href=#form-submission-0><span class=secno>4.10.15 </span>Form submission</a>
<ol>
<li><a href=#url-encoded-form-data><span class=secno>4.10.15.1 </span>URL-encoded form data</a></li>
<li><a href=#multipart-form-data><span class=secno>4.10.15.2 </span>Multipart form data</a></li>
<li><a href=#plain-text-form-data><span class=secno>4.10.15.3 </span>Plain text form data</a></ol></li>
<li><a href=#implicit-submission><span class=secno>4.10.15.1 </span>Implicit submission</a></li>
<li><a href=#form-submission-algorithm><span class=secno>4.10.15.2 </span>Form submission algorithm</a></li>
<li><a href=#url-encoded-form-data><span class=secno>4.10.15.3 </span>URL-encoded form data</a></li>
<li><a href=#multipart-form-data><span class=secno>4.10.15.4 </span>Multipart form data</a></li>
<li><a href=#plain-text-form-data><span class=secno>4.10.15.5 </span>Plain text form data</a></ol></li>
<li><a href=#resetting-a-form><span class=secno>4.10.16 </span>Resetting a form</a></li>
<li><a href=#event-dispatch><span class=secno>4.10.17 </span>Event dispatch</a></ol></li>
<li><a href=#interactive-elements><span class=secno>4.11 </span>Interactive elements</a>
<dd>Denotes elements that can be associated with <code><a href=#the-label-element>label</a></code>
elements.</dd>

</dl><p>In addition, some <a href=#category-submit title=category-submit>submittable</a> can be, depending on
their attributes, <dfn id=concept-button title=concept-button>buttons</dfn>. The
prose below defines when an element is a button.</p>
</dl><p>In addition, some <a href=#category-submit title=category-submit>submittable
elements</a> can be, depending on their attributes, <dfn id=concept-button title=concept-button>buttons</dfn>. The prose below defines when
an element is a button. Some buttons are specifically <dfn id=concept-submit-button title=concept-submit-button>submit buttons</dfn>.</p>


<h4 id=the-form-element><span class=secno>4.10.1 </span>The <dfn><code>form</code></dfn> element</h4>
<p>The <code><a href=#the-input-element>input</a></code> element represents a button that, when
activated, submits the form. If the element has a <code title=attr-input-value><a href=#attr-input-value>value</a></code> attribute, the button's label
must be the value of that attribute; otherwise, it must be an
implementation-defined string that means "Submit" or some such.</p>
implementation-defined string that means "Submit" or some such. The
element is a <a href=#concept-button title=concept-button>button</a>,
specifically a <a href=#concept-submit-button title=concept-submit-button>submit
button</a>.</p>

<p>If the element is <i title=concept-input-mutable><a href=#concept-input-mutable>mutable</a></i>,
the user agent should allow the user to activate the element.</p>

<p>The <code><a href=#the-input-element>input</a></code> element represents either an image from
which a user can select a coordinate and submit the form, or
alternatively a button from which the user can submit the form.</p>
alternatively a button from which the user can submit the form. The
element is a <a href=#concept-button title=concept-button>button</a>,
specifically a <a href=#concept-submit-button title=concept-submit-button>submit
button</a>.</p>

<hr><p>The image is given by the <dfn id=attr-input-src title=attr-input-src><code>src</code></dfn> attribute. The <code title=attr-input-src><a href=#attr-input-src>src</a></code> attribute must be present, and
must contain a <a href=#valid-url>valid URL</a> referencing a non-interactive,
<p>The <code><a href=#the-input-element>input</a></code> element represents a button that, when
activated, resets the form. If the element has a <code title=attr-input-value><a href=#attr-input-value>value</a></code> attribute, the button's label
must be the value of that attribute; otherwise, it must be an
implementation-defined string that means "Reset" or some such.</p>
implementation-defined string that means "Reset" or some such. The
element is a <a href=#concept-button title=concept-button>button</a>.</p>

<p>If the element is <i title=concept-input-mutable><a href=#concept-input-mutable>mutable</a></i>,
the user agent should allow the user to activate the element.</p>
<p>The <code><a href=#the-input-element>input</a></code> element represents a button with no
default behavior. If the element has a <code title=attr-input-value><a href=#attr-input-value>value</a></code> attribute, the button's label
must be the value of that attribute; otherwise, it must be the empty
string.</p>
string. The element is a <a href=#concept-button title=concept-button>button</a>.</p>

<p>If the element is <i title=concept-input-mutable><a href=#concept-input-mutable>mutable</a></i>,
the user agent should allow the user to activate the element. The
then the user agent should allow the user to activate the
button.</p>

<p>The element is a <a href=#concept-button title=concept-button>button</a>.</p>

<p>The <dfn id=attr-button-type title=attr-button-type><code>type</code></dfn>
attribute controls the behavior of the button when it is activated.
It is an <a href=#enumerated-attribute>enumerated attribute</a>. The following table
</table><p>The <i>missing value default</i> is the <a href=#attr-button-type-submit-state title=attr-button-type-submit-state>Submit Button</a>
state.</p>

<p>If the <code title=attr-button-type><a href=#attr-button-type>type</a></code> attribute is in
the <a href=#attr-button-type-submit-state title=attr-button-type-submit-state>Submit Button</a>
state, the element is specifically a <a href=#concept-submit-button title=concept-submit-button>submit button</a>.</p>

<p>If the element is not <a href=#concept-fe-disabled title=concept-fe-disabled>disabled</a>, the <a href=#activation-behavior>activation
behavior</a> of the <code><a href=#the-button-element>button</a></code> element is to run the
steps defined in the following list for the current state of the

<h4 id=form-submission-0><span class=secno>4.10.15 </span>Form submission</h4>

<h5 id=implicit-submission><span class=secno>4.10.15.1 </span>Implicit submission</h5>

<p>User agents may establish a <a href=#concept-button title=concept-button>button</a> in each form as being the
form's <dfn id=default-button>default button</dfn>. This should be the first <a href=#concept-submit-button title=concept-submit-button>submit button</a> in <a href=#tree-order>tree
order</a> whose <a href=#form-owner>form owner</a> is that <code><a href=#the-form-element>form</a></code>
element, but user agents may pick another button if another would be
more appropriate for the platform. If the platform supports letting
the user submit a form implicitly (for example, on some platforms
hitting the "enter" key while a text field is focused implicitly
submits the form), then doing so must cause the form's <a href=#default-button>default
button</a>'s <a href=#activation-behavior>activation behavior</a>, if any, to be
run.</p>

<p class=note>Consequently, if the <a href=#default-button>default button</a> is
<a href=#concept-fe-disabled title=concept-fe-disabled>disabled</a>, the form is not
submitted when such an implicit submission mechanism is used. (A
button has no <a href=#activation-behavior>activation behavior</a> when disabled.)</p>

<p>If the form has no <a href=#concept-submit-button title=concept-submit-button>submit
button</a>, then the implicit submission mechanism must just
<a href=#concept-form-submit title=concept-form-submit>submit</a> the
<code><a href=#the-form-element>form</a></code> element from the <code><a href=#the-form-element>form</a></code> element
itself.</p>


<h5 id=form-submission-algorithm><span class=secno>4.10.15.2 </span>Form submission algorithm</h5>

<p>When a form <var title="">form</var> is <dfn id=concept-form-submit title=concept-form-submit>submitted</dfn> from an element <var title="">submitter</var> (typically a button), the user agent must
run the following steps:</p>


</dl></li>

</ol><h5 id=url-encoded-form-data><span class=secno>4.10.15.1 </span>URL-encoded form data</h5>
</ol><h5 id=url-encoded-form-data><span class=secno>4.10.15.3 </span>URL-encoded form data</h5>

<p>The <dfn id=application/x-www-form-urlencoded-encoding-algorithm><code title="">application/x-www-form-urlencoded</code> encoding
algorithm</dfn> is as follows:</p>
<li><p>Encode <var title="">result</var> as US-ASCII and return the
resulting byte stream.</li>

</ol><h5 id=multipart-form-data><span class=secno>4.10.15.2 </span>Multipart form data</h5>
</ol><h5 id=multipart-form-data><span class=secno>4.10.15.4 </span>Multipart form data</h5>

<p>The <dfn id=multipart/form-data-encoding-algorithm><code title="">multipart/form-data</code> encoding
algorithm</dfn> is to encode the <var title="">form data set</var>
<!-- XXX define default encoding? -->


<h5 id=plain-text-form-data><span class=secno>4.10.15.3 </span>Plain text form data</h5>
<h5 id=plain-text-form-data><span class=secno>4.10.15.5 </span>Plain text form data</h5>

<p>The <dfn id=text/plain-encoding-algorithm><code title="">text/plain</code> encoding
algorithm</dfn> is as follows:</p>
61 source

</dl>

<p>In addition, some <span
title="category-submit">submittable</span> can be, depending on
their attributes, <dfn title="concept-button">buttons</dfn>. The
prose below defines when an element is a button.</p>
<p>In addition, some <span title="category-submit">submittable
elements</span> can be, depending on their attributes, <dfn
title="concept-button">buttons</dfn>. The prose below defines when
an element is a button. Some buttons are specifically <dfn
title="concept-submit-button">submit buttons</dfn>.</p>


<h4>The <dfn><code>form</code></dfn> element</h4>
activated, submits the form. If the element has a <code
title="attr-input-value">value</code> attribute, the button's label
must be the value of that attribute; otherwise, it must be an
implementation-defined string that means "Submit" or some such.</p>
implementation-defined string that means "Submit" or some such. The
element is a <span title="concept-button">button</span>,
specifically a <span title="concept-submit-button">submit
button</span>.</p>

<p>If the element is <i title="concept-input-mutable">mutable</i>,
the user agent should allow the user to activate the element.</p>

<p>The <code>input</code> element represents either an image from
which a user can select a coordinate and submit the form, or
alternatively a button from which the user can submit the form.</p>
alternatively a button from which the user can submit the form. The
element is a <span title="concept-button">button</span>,
specifically a <span title="concept-submit-button">submit
button</span>.</p>

<hr>

activated, resets the form. If the element has a <code
title="attr-input-value">value</code> attribute, the button's label
must be the value of that attribute; otherwise, it must be an
implementation-defined string that means "Reset" or some such.</p>
implementation-defined string that means "Reset" or some such. The
element is a <span title="concept-button">button</span>.</p>

<p>If the element is <i title="concept-input-mutable">mutable</i>,
the user agent should allow the user to activate the element.</p>
default behavior. If the element has a <code
title="attr-input-value">value</code> attribute, the button's label
must be the value of that attribute; otherwise, it must be the empty
string.</p>
string. The element is a <span
title="concept-button">button</span>.</p>

<p>If the element is <i title="concept-input-mutable">mutable</i>,
the user agent should allow the user to activate the element. The
then the user agent should allow the user to activate the
button.</p>

<p>The element is a <span title="concept-button">button</span>.</p>

<p>The <dfn title="attr-button-type"><code>type</code></dfn>
attribute controls the behavior of the button when it is activated.
It is an <span>enumerated attribute</span>. The following table
title="attr-button-type-submit-state">Submit Button</span>
state.</p>

<p>If the <code title="attr-button-type">type</code> attribute is in
the <span title="attr-button-type-submit-state">Submit Button</span>
state, the element is specifically a <span
title="concept-submit-button">submit button</span>.</p>

<p>If the element is not <span
title="concept-fe-disabled">disabled</span>, the <span>activation
behavior</span> of the <code>button</code> element is to run the

<h4>Form submission</h4>

<h5>Implicit submission</h5>

<p>User agents may establish a <span
title="concept-button">button</span> in each form as being the
form's <dfn>default button</dfn>. This should be the first <span
title="concept-submit-button">submit button</span> in <span>tree
order</span> whose <span>form owner</span> is that <code>form</code>
element, but user agents may pick another button if another would be
more appropriate for the platform. If the platform supports letting
the user submit a form implicitly (for example, on some platforms
hitting the "enter" key while a text field is focused implicitly
submits the form), then doing so must cause the form's <span>default
button</span>'s <span>activation behavior</span>, if any, to be
run.</p>

<p class="note">Consequently, if the <span>default button</span> is
<span title="concept-fe-disabled">disabled</span>, the form is not
submitted when such an implicit submission mechanism is used. (A
button has no <span>activation behavior</span> when disabled.)</p>

<p>If the form has no <span title="concept-submit-button">submit
button</span>, then the implicit submission mechanism must just
<span title="concept-form-submit">submit</span> the
<code>form</code> element from the <code>form</code> element
itself.</p>


<h5>Form submission algorithm</h5>

<p>When a form <var title="">form</var> is <dfn
title="concept-form-submit">submitted</dfn> from an element <var
title="">submitter</var> (typically a button), the user agent must

0 comments on commit b9facb3

Please sign in to comment.