[Bug 14870] New: autosubmit attribute for form elements

http://www.w3.org/Bugs/Public/show_bug.cgi?id=14870

           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,
                    public-html@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:
<form>
Search terms: <input type="search" name="search_terms" autosubmit>
<input type="submit">
</form>
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>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
...
</select>
<input type="submit">
</form>

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:
<form>
What gender are you?
<label><input name="gender" value="male" type="radio" autosubmit >Male</label>
<label><input name="gender" value="female" type="radio" autosubmit
>Female</label>
</form>

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:
http://www.w3.org/TR/2008/WD-html5-20080610/interactive-elements.html#menu
and there was a little discussion about it:
http://lists.w3.org/Archives/Public/public-html/2007Sep/0315.html

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 the QA contact for the bug.

Received on Friday, 18 November 2011 01:20:44 UTC