Closed webdevilopers closed 9 years ago
The readonly
attribute is not available for radio buttons:
READONLY applies to INPUT elements of type TEXT or PASSWORD and to the TEXTAREA element.
As stated a disabled
element will not be validated. Ergo should the HTML:
disabled
attribute INSTEAD OF readonly
to the input
of radio buttonsreadonly
or disabled
attribute to the ul
element anywayThis seems to be a Symfony Form Radio Button problem itself:
Closing this issue for now.
I have a
sonata_type_translatable_choice
expanded rendered as radio buttons. These buttons have to be "readonly" by default until e.g. a Javascript event "enables" it.I tried the
read_only
attribute:The HTML result:
Though the HTML attribute is passed to every single
input
but has no effect. I still can click the buttons. This seems to be the expected behaviourThe
disabled
HTML attribute is passed to theul
element but not theinput
.Using the form attribute
disabled
would have the expected effect on theinput
:but unfortunately this will complety remove the field from validation:
This assert will have no effect because it cannot add a violation to a
disabled
field.I think the latter could be an issue with Symfony forms and validation itself. Maybe this can also be regarded as the expected behaviour. A workaround would be to set the violation on a diffrent - non-disabled - element.
But shouldn't the HTML template add the
disabled
attribute to theinput
s then?Related issues: