W3C home > Mailing lists > Public > public-html@w3.org > November 2011

[Bug 14870] New: autosubmit attribute for form elements

From: <bugzilla@jessica.w3.org>
Date: Fri, 18 Nov 2011 01:20:43 +0000
To: public-html@w3.org
Message-ID: <bug-14870-2495@http.www.w3.org/Bugs/Public/>

           Summary: autosubmit attribute for form elements
           Product: HTML WG
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HTML5 spec (editor: Ian Hickson)
        AssignedTo: ian@hixie.ch
        ReportedBy: david@nnucomputerwhiz.com
         QAContact: public-html-bugzilla@w3.org
                CC: mike@w3.org, public-html-wg-issue-tracking@w3.org,

Currently javascript is frequently used to submit simple html forms with a
small number of controls. Implementing an autosubmit boolean attribute for all
form elements would eliminate the need to use javascrpt's onchange method to
call a form's submit method and provide a better user experience especially on
mobile devices. 

One use case would be a simple search form like so:
Search terms: <input type="search" name="search_terms" autosubmit>
<input type="submit">
Once the user has enter their data using a touch keyboard on a mobile device
and tapped "done" to close the keyboard the form would be automatically
submitted with the user needing to tap the submit button. 

The above use case is most useful for mobile devices while placing an
autosubmit attribute on a <select> element for paginating content would be
useful for any device:
<form action="content">
Page: <select name="page" autosubmit>
<input type="submit">

Once the user selected a different option the form would auto-submit and the
chosen page would be displayed. There are many sites that currently use
javascript and onchange events to autosubmit such forms used for pagination.

Other possible use cases would be a survey asked one multiple choice question
per page. Each question could be answered by simply selecting the appropriate
radio button without needed to click submit. Like so:
What gender are you?
<label><input name="gender" value="male" type="radio" autosubmit >Male</label>
<label><input name="gender" value="female" type="radio" autosubmit

In the above case it might be better also define an autosubmit attribute for
the form element itself. This would make the form auto-submit if any of it's
elements were changed and eliminate the need to specify autosubmit for each
element in the form as above. 

Other use cases would be <input type="file" autosubmit> which would submit the
form once a file is selected by the browser. 

This attribute was previously proposed for menu elements:
and there was a little discussion about it:

I'm not entirely sure why it was removed from the spec, other than the fact
that it was more appropriate for form elements.

Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
Received on Friday, 18 November 2011 01:20:53 UTC

This archive was generated by hypermail 2.4.0 : Saturday, 9 October 2021 18:45:45 UTC