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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

All other Modules /

Discuss all other Modules here.

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

Userforms numeric field


Go to End


2 Posts   1265 Views

Avatar
MCK

Community Member, 18 Posts

4 March 2011 at 12:51pm

I have made a new numeric field successfully (based on text field) but where do I change the class name that appears in the html. I need to be able to target this field specifically in the .css file and right now it has a class of "field text" -- as do all other text fields. I can see no .ss files that controls this. Do I need to make a new file .ss? If so, what do I call it and what should it contain?

Thanks

Graeme McKinstry

Avatar
Willr

Forum Moderator, 5523 Posts

11 March 2011 at 6:16pm

You can add classes to form fields using addExtraClass, simply change your numeric fields getFormField() to call addExtraClass() before you return it.