Task #13342

Task #26664: Clean up Form ViewHelpers

Task #26658: Make Form ViewHelpers consistent

f:form.checkbox does only render hidden input for first item of same name

Added by martin no-lastname-given over 4 years ago. Updated about 3 years ago.

Status:Resolved Start date:2011-02-24
Priority:Should have Due date:
Assigned To:Bastian Waidelich % Done:

100%

Category:ViewHelpers
Target version:-
Has patch:No

Description

If you attempt to have multiple forms on the same page with inputs that have the same name-attr (i.e. multiple forms for items of the same type) the viewhelper will only render a hidden input for the first item. This means that only the first form will work as expected whereas all subsequent forms will have limited functionality.


Related issues

related to TYPO3.Fluid - Bug #26481: hidden fields should be rendered in extra section Resolved 2011-04-29

Associated revisions

Revision f25fa5fb
Added by Bastian Waidelich about 3 years ago

[BUGFIX] hidden fields should be rendered in extra section

Currently form.select and form.checkbox ViewHelpers render
hidden fields before the actual input field in order to
force submission of a value.
This leads to the situation that labels wrapped around the
field do not correspond to the actual form field, but to
the hidden field.
This is fixed by letting the form ViewHelper taking care of
rendering the requried hidden fields in the already existing
section on top of the form.

Change-Id: I77cc9061a36d2a2984bf479868b1138c513e47f8
Fixes: #26481
Fixes: #13342
Releases: 1.1, 1.2

Revision 9f01a42d
Added by Bastian Waidelich about 3 years ago

[BUGFIX] hidden fields should be rendered in extra section

Currently form.select and form.checkbox ViewHelpers render
hidden fields before the actual input field in order to
force submission of a value.
This leads to the situation that labels wrapped around the
field do not correspond to the actual form field, but to
the hidden field.
This is fixed by letting the form ViewHelper taking care of
rendering the requried hidden fields in the already existing
section on top of the form.

Change-Id: I77cc9061a36d2a2984bf479868b1138c513e47f8
Fixes: #26481
Fixes: #13342
Releases: 1.1, 1.2

History

#1 Updated by Sebastian Kurfuerst about 4 years ago

  • Parent task set to #26658

#2 Updated by Robert Lemke almost 4 years ago

  • Target version changed from 1.0 beta 2 to 1.0.0

#3 Updated by Karsten Dambekalns almost 4 years ago

  • Target version deleted (1.0.0)

#4 Updated by Bastian Waidelich over 3 years ago

  • Status changed from New to Closed
  • Assigned To set to Bastian Waidelich
  • Has patch set to No

The current behavior is intended: We only need the hidden field so that the server gets an empty value if you don't tick the checkox (or radio button).
If multiple checkboxes have the same name, we only need the hidden field before the first of them. If we would add a hidden field after a checkbox with the same name, the checkbox value would have no effect.

#5 Updated by Bastian Waidelich about 3 years ago

  • Status changed from Closed to Needs Feedback

Hi Martin ;)
I just checked this one again and I think, I missunderstood you.
Are you saying, that the hidden field is not generated in a second form, when you use the same name for a checkbox? That would be a bug, indeed. Each form should reset the counter. Are you using the provided f:form ViewHelper?

#6 Updated by Bastian Waidelich about 3 years ago

  • Status changed from Needs Feedback to Accepted

Bastian Waidelich wrote:

[...] the hidden field is not generated in a second form, when you
use the same name for a checkbox? That would be a bug, indeed.

I just checked this, and this is really the case. I'll resolve that with #26481 for FLOW3 1.1 and backport this asap.

#7 Updated by Gerrit Code Review about 3 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/11648

#8 Updated by Sebastian Kurfuerst about 3 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#9 Updated by Gerrit Code Review about 3 years ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch FLOW3-1.1 has been pushed to the review server.
It is available at http://review.typo3.org/12158

#10 Updated by Bastian Waidelich about 3 years ago

  • Status changed from Under Review to Resolved

Also available in: Atom PDF