Jump to:

23552 Posts in 19349 Topics by 2891 members

General Questions

SilverStripe Forums » General Questions » Adding a class to radio field?

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

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

Page: 1
Go to End
Author Topic: 2049 Views
  • Ryan M.
    Avatar
    Community Member
    309 Posts

    Adding a class to radio field? Link to this post

    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?

  • Willr
    Avatar
    Forum Moderator
    5511 Posts

    Re: Adding a class to radio field? Link to this post

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

    2049 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.