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, biapar, Willr, Ingo, swaiba, simon_w

adding style classes to a customform


Reply


2 Posts   971 Views

Avatar
TerryMiddleton

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?

Terry

Avatar
Willr

Forum Moderator, 5513 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 http://api.silverstripe.com/forms/core/FormField.html#addExtraClass for more information