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.

Archive /

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

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

A few tablefield questions...


Go to End


2 Posts   1897 Views

Avatar
dio5

Community Member, 501 Posts

22 September 2007 at 7:52am

Edited: 22/09/2007 7:54am

I've been looking for a few examples for various stuff:

- how to set default values for fields in TableField where the fieldtypes are set in another class
- how to have validation on this fields and on fields in the backend in general, like emailfield...I see that there's this function jsValidation(), setRequiredFields(),... , an example on when and where to use it would help a lot

many thanx

Avatar
Ingo

Forum Moderator, 801 Posts

7 October 2007 at 2:48am

i've slightly modified the docs at http://doc.silverstripe.com/doku.php?id=tablefield.
they now describe how to add validation to a TableField.

> how to set default values for fields in TableField where the fieldtypes are set in another class
it is currently not possible to set default values for visible formfields inside a TableField. you have to use setExtraData() which produces HiddenFields.