-- fozzyuw <[EMAIL PROTECTED]> wrote
(on Wednesday, 22 October 2008, 01:58 PM -0700):
> My problem/question is, how can I determine which subForm is triggering the
> invalid flag? $form->getErrors() and $form->getMessages() seem to only
> return the number 1 and I can't seem to find any meaning behind this.
>
> Is this something were I'll just have to loop over all the subForms and call
> "isValid" myself and keep track of it, or does $form->isValid() give any
> other data back that I can use to return a proper error message and perhaps
> set a mark on which subForm is causing the error (so the user can go to that
> subForm and correct it).
SubForms are namespaced -- so you can do the following:
$errors = $form->getMessages();
and look through the keys to that to see which forms threw errors. :)
--
Matthew Weier O'Phinney
Software Architect | [EMAIL PROTECTED]
Zend Framework | http://framework.zend.com/