Bug #5512

form view helper produces invalid XHTML output

Added by Bastian Waidelich over 5 years ago. Updated almost 5 years ago.

Status:Resolved Start date:2009-11-26
Priority:Could have Due date:
Assigned To:Bastian Waidelich % Done:

100%

Category:ViewHelpers
Target version:-
Has patch: Affected Flow version:

Description

By default the form view helper inserts hidden fields for referrer & hmac to the generated form at the very top.
I just found out, that this is not XHTML compliant as In XHTML 1.0 Strict mode all inputs have to be put in a block element.

I'd suggest to wrap the auto-generated hidden fields by

<div style="display: none"></div>

5512_form_view_helper_produces_invalid_XHTML_output.patch Magnifier (2.8 kB) Bastian Waidelich, 2009-11-26 15:13

5512_form_view_helper_produces_invalid_XHTML_output_v2.patch Magnifier - version 2 with tweaked output (2.8 kB) Bastian Waidelich, 2009-11-26 15:37


Related issues

related to TYPO3.Fluid - Task #6521: form ViewHelper: add "objectName" argument that overrules... Resolved 2010-02-19

Associated revisions

Revision dadfec9c
Added by Bastian Waidelich about 5 years ago

[+BUGFIX] Fluid (ViewHelpers): FormViewHelper wraps hidden fields with a div tag to create XHTML valid output. This fixes #5512

History

#1 Updated by Bastian Waidelich over 5 years ago

@Sebastian: could you please verify the attached patch and commit if ok?

#2 Updated by Bastian Waidelich over 5 years ago

new version with tweaked output (new lines)

#3 Updated by Bastian Waidelich over 5 years ago

Mh.. another XHTML compatibility issue:
in XHTML 1.0 Strict it's not allowed to set the "name" attribute of the form tag. The problem is: Fluid relies on the name attribute..

#4 Updated by Thomas Deinhamer over 5 years ago

I'd use a fieldset element instead of a div element,
seems to me more "native".

#5 Updated by Sebastian Kurfuerst over 5 years ago

  • Status changed from New to Needs Feedback
  • Assigned To deleted (Sebastian Kurfuerst)
  • Priority changed from Must have to Could have

We need to discuss this issue, as I somehow have a bad gut feeling when the <f:form> adds markup like "div".

#6 Updated by Bastian Waidelich over 5 years ago

  • Assigned To set to Sebastian Kurfuerst

Sebastian Kurfuerst wrote:

I somehow have a bad gut feeling when the <f:form> adds markup like "div".

I don't know.. It already does add additional HTML, which I don't really like. But there is no way around that yet* - so at least they should be added in a (X)HTML compliant way in my opinion.

btw: I'm reassigning this to you so you get notified ;)

  • In FLOW3 there will be a request stack that might make this "hidden field magic" unnecessary. Do you remember if something like this planned too for extbase?

#7 Updated by Sebastian Kurfuerst about 5 years ago

  • Assigned To deleted (Sebastian Kurfuerst)

#8 Updated by Bastian Waidelich about 5 years ago

  • Assigned To set to Bastian Waidelich

#9 Updated by Bastian Waidelich about 5 years ago

  • Status changed from Needs Feedback to Resolved
  • % Done changed from 0 to 100

Applied in changeset r4872.

Also available in: Atom PDF