Question

How can I go about add a css class to the CheckboxSetField below - I've tried the setAttribute method but it has no effect (using SS 3.0):

$checkboxFieldSet = new CheckboxSetField('CampusPage', 'Campuses (select multiple)*', $campusArea->map());
Was it helpful?

Solution

$checkboxFieldSet->addExtraClass("my-class");

API Docs: http://api.silverstripe.org/3.1/class-FormField.html#_addExtraClass

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top