I'd like to add a class to a set of radio fields, so they can be styled via javascript/css. How can this be done with the OptionsetField?
We've moved the forum!
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
FormFields have a method addExtraClass() which you can use to add extra classes (think it does it to the container)
$radio = new OptionsetField(....
$radio->addExtraClass('classname');