Bug #14491
closedXHTML 1.0 strict compliance of FORM objects (hidden fields)
0%
Description
FORM objects generate hidden fields that are not enclosed by any other block-level tags. This is not legal according to XHTML 1.0 strict, so e.g. pages with a mailform content object fail to validate. Attached is a patch to solve this problem (it just adds a <div> around the hidden fields block).
(issue imported from #M678)
Files
Updated by Michael Scharkow almost 20 years ago
Any counterarguments against this fix?
edited on: 03.02.05 23:32
Updated by Martin Kutschker almost 20 years ago
Hm, in 3.7 the hidden fields simply appear after the form tag. So it's up to the surrounding xhtml to supply a block-level tag.
Updated by Ernesto Baschny over 19 years ago
Error from w3's validator is (XHTML 1.1 strict!):
document type does not allow element "input" here; missing one of "ins", "del", "h1", "h2", "h3", "h4", "h5", "h6", "p", "div", "address", "fieldset" start-tag
In my case, the content area where this mailform is placed in is already inside a <div id="content"> so there is a surrounding block-level tag. But still, the input fields cannot "hang around" after the form tag. They must be enclosed inside a blockl-level tag, e.g. a <div>.
Updated by Martin Kutschker over 19 years ago
Improved patch adds display:none to the div.
Updated by Karsten Dambekalns over 19 years ago
One can probably see this in different ways, but requiring a block level element around a hidden field seems nonsense to me. Pffft.
Other than that, the patch looks good and should do no harm.
Updated by Michael Stucki over 19 years ago
Fixed in 3.8 but only if the "accessibility" property is set.
Updated by Martin Kutschker over 19 years ago
While valid XHTML is currently mainyl an accessibility issue, this xhtml bug should be fixes regardless of the setting of the accessibility flag. So the bug must remain open until this depency is removed.
The div does no harm, so why the check?
Updated by Michael Stucki over 19 years ago
OK, convinced me. I didn't realise that display:none was set!