You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.
An element's label can get attributes, e.g. class. Theoretically this behavior is also possible for radio buttons. But the setLabelAttributes(['class' => 'my_class']) called on a Zend\Form\Element\Radio object sets the attribute(-s) for the input elements and not for the container-element.
And it's not possible to access the fieldset or the legend element, that are "hard-coded" in the Zend\Form\View\Helper\FormRow. (Also the maintaining of a custom view helper for the 135 rows long FormRow#render(...) is not easy.)
It would be nice to be able to set the fieldset's and legend's attributes of radio buttons / multi_checkbox'es (and generally of all elements, affected by this code).
An example of a situation, when it's need, is makring elements as required using the :before CSS pseudo-class. For text fields it can be managed by setting the class attribute for the label. For radio's an access to the fieldset and/or at least to the legend is needed.
The text was updated successfully, but these errors were encountered:
There appears to be no way to add attributes, such as an id to the generated fieldset that gets created for Element\Radio button, when ['options']['label'] value is used. I can add attributes to the individual <label> tags, or to the individual <input> tags, but not to the enveloping <fieldset> tag.
Currently, I used CSS selectors/pseudo-classes to get around this issue.
An element's
label
can get attributes, e.g.class
. Theoretically this behavior is also possible for radio buttons. But thesetLabelAttributes(['class' => 'my_class'])
called on aZend\Form\Element\Radio
object sets the attribute(-s) for theinput
elements and not for the container-element.And it's not possible to access the
fieldset
or thelegend
element, that are "hard-coded" in theZend\Form\View\Helper\FormRow
. (Also the maintaining of a custom view helper for the135
rows longFormRow#render(...)
is not easy.)It would be nice to be able to set the
fieldset
's andlegend
's attributes of radio buttons /multi_checkbox
'es (and generally of all elements, affected by this code).An example of a situation, when it's need, is makring elements as required using the
:before
CSS pseudo-class. For text fields it can be managed by setting the class attribute for the label. Forradio
's an access to thefieldset
and/or at least to thelegend
is needed.The text was updated successfully, but these errors were encountered: