Hi all, and thanks in advance!

Ok, so I've got a multi-page SubForm going.  It's working pretty good at
this point.  I just have one head scratcher.  Here's my general setup...

I have 9 subForms and the first 2 subForms have required fields.  There's a
subForm navigation that lets the user jump between any of the subForms at
will and each subForm page has 4 buttons to: 

* save subForm (performs subForm->isValid and saves to session)
* Submit the whole Form ($form->isValid)
* refresh the page
* Cancel the form (removes the form session)

This lets the user jump around to any subForm of the entire form and fill
stuff in as desired (part of the user request for this application).  The
user will save a subForm when they're done filling it out and use the Submit
button to process the entire form.

$form-isValid() will be true if all required fields are valid.  SubForms
without required fields don't need to be filled out at all.  However, since
the user can jump around, at will, they could accidentally skip one of the
subForms that has a required field.

If they do this, the $form->isValid() will return false.

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).

I hope that makes sense.

Cheers,
Fozzy

-- 
View this message in context: 
http://www.nabble.com/Zend_Form---Multipage-SubForm-and-isValid-tp20119685p20119685.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to