Closed
Bug 350284
Opened 19 years ago
Closed 19 years ago
Form without action attribute isn't submitted when in XHTML
Categories
(Firefox :: General, defect)
Tracking
()
RESOLVED
INVALID
People
(Reporter: p.mozilla.org, Unassigned)
Details
Attachments
(2 files, 1 obsolete file)
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.5) Gecko/20060807 Firefox/1.5.0.5
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.5) Gecko/20060807 Firefox/1.5.0.5
When a form element without an action attribute is submitted it is usually posted to the same URL it came from. This works in FF when the content type is text/html, but changing it to text/xml (assuming that it was a well-formed XHTML document in the first place) will break this feature, and the submit button will have no effect.
Reproducible: Always
Steps to Reproduce:
1. Create a valid XHTML document with a form tag without an action attribute
2. Load the document in FF
3. Submit the form using a submit button (<input type="submit" />)
Actual Results:
The button is clicked but nothing happens. No new request is made to the server and no error is displayed.
Expected Results:
I'd expect it to behave the same way as non XHTML documents behave - submit the form to the originating URL.
I've created an XHTML document as detailed above in a JSP file. Adding a single line at the top of the JSP fixes the problem:
<% response.setContentType("text/html");%>
Of course, I loose XML validation this way.
| Reporter | ||
Comment 1•19 years ago
|
||
Here's an example XHTML document. This should be sent to the browser using text/xml content type to display the problem. Sending it as text/html will work properly.
| Reporter | ||
Updated•19 years ago
|
Version: unspecified → 1.5.0.x Branch
Comment 2•19 years ago
|
||
Marking this as invalid for the following reason.
According to the W3C HTML 4.01 specification - http://www.w3.org/TR/html4/interact/forms.html#h-17.3
> action %URI; #REQUIRED -- server-side form handler --
Seeing as without this element Firefox has no idea where you actually intend to submit the data too and the W3C specification says it must be present (required) this is not a bug but works in conformance with the W3C specification.
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → INVALID
| Reporter | ||
Comment 3•19 years ago
|
||
Then how do you explain that it works when not using XHTML?
I know this is not according to the spec, but its an undocumented feature many sites (and I've even seen an official example in spring-mvc) rely on.
| Reporter | ||
Comment 4•19 years ago
|
||
I'm reopening the bug to get some attention, I'm sorry if this is not appropriate.
Please read my previous comment, I believe this is a bug. Thanks.
Status: RESOLVED → UNCONFIRMED
Resolution: INVALID → ---
Comment 5•19 years ago
|
||
Attachment #235552 -
Attachment is obsolete: true
Comment 6•19 years ago
|
||
Comment 7•19 years ago
|
||
(I had to cheat, and ask one of the editors of the DOM HTML 2 spec, but it turned out my first guess was right.)
The problem is that when you serve something as text/xml, you don't get an HTML DOM, so you don't get things that are specific to HTML, like assumptions that a missing action attribute should go to the base URI for the page. Once we see "text/xml" incoming, you get a generic XML DOM, and then when it turns out to have some XHTML in it, well, we know what that should look like, but you've still got an XML DOM. As application/xhtml+xml, so we know to start building an XHTML DOM, it works fine.
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago → 19 years ago
Resolution: --- → INVALID
| Reporter | ||
Comment 8•19 years ago
|
||
Thanks, that seems to work. So is the bug in Tomcat for not sending the correct content type for JSPX, or should FF figure out this is an XHTML even with a wrong content type?
You need to log in
before you can comment on or make changes to this bug.
Description
•