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.

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   3893 Views

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?


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(....