Wednesday, July 1, 2009

Validating associated models fields - cannot get it working.

I have a form where users can add tags/images at the same time as
adding a post.

These fields are referenced like this in the view:

echo $form->input('Img.pic')
echo $form->input('Tag.name')

I am trying to add validation rules to these fields in the post model,
referencing the fields as follows:

'Img.pic' => array(
// rules etc. go here
)

'Tag.name' => array(
// rules etc. go here
)

I have also tried adding validation rules to the Tag model (no Img
model exists because it is a component).

How should I be doing this? I have searched but cannot find a
solution. I have tried various validation rules and the rest of the
models validation rules are working fine.

Would appreciate any suggestions!
--~--~---------~--~----~------------~-------~--~----~
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 cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: