This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 13320 - New Feature: Define a default form submit behavior. Currently, there is no specified behavior that I am aware of for browsers when the 'enter' key is pressed in a text input field inside a form. Some browsers submit using the form with no button value.
Summary: New Feature: Define a default form submit behavior. Currently, there is no sp...
Status: RESOLVED DUPLICATE of bug 9280
Alias: None
Product: HTML WG
Classification: Unclassified
Component: LC1 HTML5 spec (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: ---
Assignee: Ian 'Hixie' Hickson
QA Contact: HTML WG Bugzilla archive list
URL: http://www.whatwg.org/specs/web-apps/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-21 18:25 UTC by contributor
Modified: 2011-08-14 09:59 UTC (History)
5 users (show)

See Also:


Attachments

Description contributor 2011-07-21 18:25:36 UTC
Specification: http://www.w3.org/TR/html5/
Multipage: http://www.whatwg.org/C#top
Complete: http://www.whatwg.org/c#top

Comment:
New Feature: Define a default form submit behavior.

Currently, there is no specified behavior that I am aware of for browsers when
the 'enter' key is pressed in a text input field inside a form.  Some browsers
submit using the form with no button value.  Some browsers submit using the
first submit button found in the form.	As web app developers, it would be
helpful to be able to declaratively define that behavior, even on a per input
basis.

Consider a large form with a paging form control.  The paging control allows
the user to move back and forth between sections of the form. 

At the beginning of the form, there's a 'save' button. Following that are some
form fields.  At the bottom of the form there's also one text input to update
the current page number. On either side of the field, there are 'back' and
'forward' buttons to increment/decrement the page number one page at a time.

You can see the problem now.  If I change any form input field and press
enter, in some browsers, the value of the save button is submitted as well. 
If I am in the fields before the paging control, this may be the desired
behavior.  If I am just changing the page number, it is most likely not the
desired behavior.  

If I break the paging into a separate form, some browsers will still submit
the 'back' form button when updating the page number, and all the values the
user may have entered into the now separate main form will be lost.

Since forms are central to any web app, web developers have been required for
years to create javascript 'solutions' which simply don't work when scripting
is disabled. There needs to be a declarative way to assign a default button to
a particular input field and a clearly defined behavior for cases where forms
are submitted and no default button is assigned.

Thank you.

Posted from: 65.121.92.28
User agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_8; en-us) AppleWebKit/533.21.1 (KHTML, like Gecko) Version/5.0.5 Safari/533.21.1
Comment 1 Michael[tm] Smith 2011-08-04 05:33:59 UTC
mass-move component to LC1
Comment 2 Anne 2011-08-14 09:59:35 UTC

*** This bug has been marked as a duplicate of bug 9280 ***