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 style classes to a customform

Go to End

2 Posts   1193 Views


Community Member, 108 Posts

19 May 2009 at 8:28am

How can you add a style class to a form or even a custom form?

I'm using jquery to validate a customform build but I need to add some style classes to the field.

How is this possible?



Forum Moderator, 5523 Posts

19 May 2009 at 1:52pm

Edited: 19/05/2009 1:53pm

Adding classes to the form or the form fields? If you want to add classes to a field you can do $field->addExtraClass('Something'); as long as $field is a valid FormField object

See for more information