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.

Archive /

Our old forums are still available as a read-only archive.

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

Add a custom class to requiredfields


Reply


2 Posts   1628 Views

Avatar
dio5

Community Member, 501 Posts

1 October 2007 at 11:16pm

Any ideas how I can add a class to formfields that are required?
I can see classes of "field text" but not "required"?

Also, how can I add a * to the label of requiredfields? I found this method "fieldIsRequired ()" but I'm not sure how to use it to add content to labels?

Avatar
dio5

Community Member, 501 Posts

5 October 2007 at 12:32am

maybe this?

[url]http://doc.silverstripe.com/assets/classes/default/FormField.html#methodsetExtraClass[/url]