HTML Standard Tracker

Diff (omit for latest revision)
Filter

Short URL: http://html5.org/r/2379

File a bug

SVNBugCommentTime (UTC)
2379[Gecko] [Internet Explorer] [Opera] [Webkit] Define 'button' and 'default button' and define implicit form submission.2008-10-29 08:46
Index: source
===================================================================
--- source	(revision 2378)
+++ source	(revision 2379)
@@ -25232,10 +25232,11 @@
 
   </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>
@@ -28448,7 +28449,10 @@
   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>
@@ -28520,7 +28524,10 @@
 
   <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>
 
@@ -28730,7 +28737,8 @@
   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>
@@ -28797,7 +28805,8 @@
   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
@@ -29598,6 +29607,8 @@
   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
@@ -29630,6 +29641,11 @@
   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
@@ -31288,6 +31304,35 @@
 
   <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

|