Jump to:

3373 Posts in 998 Topics by 712 members

Data Model Questions

SilverStripe Forums » Data Model Questions » validation for new data object

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

Page: 1
Go to End
Author Topic: 363 Views
  • Nicolaas
    Avatar
    Forum Moderator
    213 Posts

    validation for new data object Link to this post

    Hi

    What is the best practice for validating objects - for example, if you want to make sure that a data object always has a "date of birth" entered. I know how to add "required fields" to a form - but what if you just want to validate data objects no matter how they are entered.

    I use the validate method, like this: http://pastie.org/2869826 - but this only works for "previously created" objects and not for new objects (at least when adding it through modeladmin).

    Am I missing anything?

    --
    Nicolaas

    363 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.