Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

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.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Adding a class to radio field?


Go to End


2 Posts   4890 Views

Avatar
Ryan M.

Community Member, 309 Posts

28 April 2010 at 12:39pm

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?

Avatar
Willr

Forum Moderator, 5523 Posts

28 April 2010 at 9:14pm

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');