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 13054 - WF3: Allow one input to be part of multiple forms
Summary: WF3: Allow one input to be part of multiple forms
Status: RESOLVED WONTFIX
Alias: None
Product: HTML WG
Classification: Unclassified
Component: LC1 HTML5 spec (show other bugs)
Version: unspecified
Hardware: All All
: P5 enhancement
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-06-25 07:48 UTC by contributor
Modified: 2011-08-14 06:43 UTC (History)
7 users (show)

See Also:


Attachments

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

Comment:
I am referring to this section of the HTML5 spec:

http://www.w3.org/TR/html5/association-of-controls-and-forms.html#association-
of-controls-and-forms

Decoupling form controls and the form element is a good first step to
improving the flexibility of web forms, but I think we should go one step
further: allowing a single form-associated element to be associated with
multiple forms. I propose that there may be circumstances where application
developers may want to create a form containing several inputs, but to also
associate sub-groups of those inputs with another form.

I propose that the syntax of the form attribute be modified to work like the
class attribute does. rather than containing a single form id, the form
attribute should be a space-separated list of form ids.

I recognize some difficulties in this approach, for example:
- Submit inputs and buttons obviously cannot attempt to submit multiple forms
at once, so the proposed syntax should be invalid for those elements.

- When clearing a form which contains an input that is associated with a
second form, it is unclear what the expected behavior of that input would be.
Should the input be cleared, or remain populated?

I think good solutions can be found for these problems, and, if there is
interest among the group, this new syntax could be adopted and may prove
useful to many developers.

Thanks for reading. I hope I made my case well. 

Posted from: 71.61.178.237
User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_7) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.24 Safari/535.1
Comment 1 Nicholas Sloan 2011-06-25 07:57:11 UTC
Here is a short use case:

I have a shopping cart page with an input for each item in my cart which allows me to update the quantity of that item. I have a form for each of these inputs that points to a script that saves the quantity of the item in my cart. I also have all of the inputs associated with a form that saves all of the quantity values (and possibly some other fields) and directs the user to a checkout page.
Comment 2 Anne 2011-06-25 09:52:38 UTC
This used to be in Web Forms 2.0 (and Opera). We dropped it to make the specification simpler. It also gave problems with radio buttons and checkboxes, if I remember correctly.
Comment 3 Aryeh Gregor 2011-06-26 22:19:21 UTC
Not sure if the use-case is compelling, particularly since it could easily be done by script.  Generally if something is doable by script, we require that it be very commonly needed before we're willing to add a declarative way to do it.  I encourage you to provide as many distinct, common use-cases as possible to make a case for your proposal.  The one you gave is a good start.
Comment 4 Michael[tm] Smith 2011-08-04 05:14:34 UTC
mass-move component to LC1
Comment 5 Ian 'Hixie' Hickson 2011-08-14 06:43:29 UTC
EDITOR'S RESPONSE: This is an Editor's Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document:
   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Rejected
Change Description: no spec change
Rationale: As Anne says, we actually did this a few years ago. It was more trouble than it's worth and really there aren't as many use cases as you'd think. In practice you generally end up having to have script anyway so it's no big loss.