On Apr 29, 6:00 pm, brian <[email protected]> wrote:
> Just use a rule (eg. notEmpty) for each of them. You'll get errors for
> whichever fields were not set.

No, "notEmpty" will fail validation, if the field is present but
empty. It will NOT fail, if the field is not set at all.

If the field MUST be set, use 'required'=>true (and still use the
notEmpty rule, if empty values should not be allowed).

See http://book.cakephp.org/view/129/required

I just learned the difference the hard way... ;-)

I don't think the case when none of the fields are present can be
handled by validation rules, but starkey has given a solution for
this.

  Regards

    Jonathan

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to