Hi Markus, actually I solved the problem already with some sort of workaround, but I'll have a look at the article nevertheless. Thanks!
Regards Guenther Braindead schrieb: > Hi Günther, > > just in case you haven't already solved this problem, the following > link to the bakery should lead you into the right direction: > http://bakery.cakephp.org/articles/view/multivalidatablebehavior-using-many-validation-rulesets-per-model > > Regards, > Markus > > > > On 22 Sep., 14:25, Günther Theilen <[EMAIL PROTECTED]> wrote: >> Hi, >> >> I'm struggling a bit to set up the right validation rules for my >> application, maybe someone has a hint. >> >> Let's say there are two models: User hasOne Profile >> The users belong to different groups and the profiles differ a bit >> according to the group. >> >> Users in group "1" have to enter data for the profile-field "foo". >> Users in group "2" have to enter data for the profile-field "bar". >> Users in group "1" don't even see the form field "bar". >> Users in group "2" don't even see the form field "foo". >> >> If I'm not mistaken, custom validation rules are only triggered if the >> field exists in the form data. >> So, if a user from group "1" fumbles around with the form and sends it >> without the "foo"-field, my custom validation would not work. Right? >> >> How would you set up the validation rules for this, especially the part >> that the fields are required only for users in some groups? >> >> Regards >> Guenther > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---