Closed Bug 755215 Opened 12 years ago Closed 12 years ago

Firefox does not respect the fieldset's form attribute.

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: paracet2, Unassigned)

References

Details

User Agent: Opera/9.80 (Windows NT 6.1; U; nb) Presto/2.10.229 Version/11.64

Steps to reproduce:

I created a html file containing a  form with an id, the same html file contained a fieldset with input elements. The fieldset had the attribute form set to the value of the form's id.


Actual results:

When submitting the form, the value from the input elements in the fieldset did not get posted


Expected results:

With the fieldsets form attribute one is allowed to post values from input elements which is not nested inside the form which is submitted. This works out nicely in opera where one can post values from a fieldset outside the form.

Ref: http://www.w3.org/TR/html5/association-of-controls-and-forms.html#form-owner
Not sure if posting html code here works, but I'll give it a go. Here is the HTML to reproduce the issue:
<pre>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="no" lang="no">
<head>
	<meta charset="utf-8"/>
	<meta name="description" content="Fieldset test" />
	<meta name="author" content="Magnus Oen Pedersen" />
	<title>Fieldset test</title>
</head>
<body>
	<div id="container">
		<form id="predictions" method="POST" action="example.html">
			<input type="submit" value="Lagre" name="submit" />
		</form>
		<fieldset form="predictions"><legend>Test A</legend>
			<input type="radio" name="test_a" value="h"  />
			<input type="radio" name="test_a" value="d"  />
			<input type="radio" name="test_a" value="a"  />
		</fieldset>
	</div>
</body>
</html>
</pre>
Component: Untriaged → HTML: Form Submission
Product: Firefox → Core
QA Contact: untriaged → form-submission
The spec you linked to says pretty clearly that for an input the browser must:

1)  Look at the "form" attribute of the input.
2)  Look up the parent chain for a form.

In your case neither finds a form, so the inputs are not associated with any form.

Or put another way, you have to have form="predictions" on each input you want associated with that form; you can't just put them on some container, per spec.

Resolving invalid, but maybe it's worth pushing to get the spec changed....
Status: UNCONFIRMED → RESOLVED
Closed: 12 years ago
Resolution: --- → INVALID
I've open a bug against the HTML specifications. If it happens to be accepted, I will reopen this bug and implement the feature.
Component: HTML: Form Submission → DOM: Core & HTML
OS: Windows 7 → All
QA Contact: form-submission → general
Hardware: x86 → All
Version: 9 Branch → Trunk
You need to log in before you can comment on or make changes to this bug.