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

A few tablefield questions...


Reply


2 Posts   1521 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.