Hi Konr , 

yes, you're right, I was mistaking in another part of my code and also not to 
pass tha required argument, 

I've found it a few minutes after I opened this post and replied to 
my own question, but I see the message "This post has NOT been accepted 
by the mailing list yet." so maybe you cannot see it.


However, thank you for your answer, is always good to have some good advice 
from a friend!


Regards


Sergio Rinaudo




> Date: Mon, 19 Sep 2011 14:11:14 -0500
> Subject: Re: [fw-general] Zend_Form and getValidValues
> From: konrn...@gmail.com
> To: kaiohken1...@hotmail.com
> CC: fw-general@lists.zend.com
> 
> I don't think getValidValues() is the right method for your needs.
> 
> When you call isValid($data) on a form, the form elements are
> populated and validated. getValidValues() is expecting a parameter of
> $data as well, but in looking through the code it looks like it passes
> on values that don't exist in the form.
> 
> So, instead you should just call getValues() on the form. This will
> return only the values for form elements that exist in the form.
> 
> Konr
> 
> On Thu, Sep 15, 2011 at 4:50 PM, Sergio Rinaudo
> <kaiohken1...@hotmail.com> wrote:
> >
> > Hello Everyone,
> > I am a bit confused with the "getValidValues" method of Zend_Form.
> > I am using ZF 1.11.10.
> >
> > I'll explain my problem:
> >
> > I'm trying to get all the valid values of the $data array.
> >
> > $isValid = $form->isValid( $data );
> >
> >            if( $isValid ) {
> >                $validValues = $form->getValidValues();
> >                Zend_Debug::dump( $validValues, 'validValues' ); exit;
> >            } else {
> >                 Zend_Debug::dump( $form->getErrors() ); exit;
> >            }
> >
> > If $data contains keys that are not form elements, $validValues will 
> > contains them.
> > Is that the correct behaviour of this method?
> >
> > The result I would is an array of data that is valid and is present as a 
> > form element, discarding what is not present,
> > is there any way to accomplish this using Zend Form methods or maybe am I 
> > mistaking something?
> >
> > Thanks
> >
> > Sergio
> >
> >
> >
                                          

Reply via email to