Is it possible to pass the POST variable(s) once instead of twice when using
the identical validator?

What I have is a method in a model that checks a param which is passed when
the form is generated in the controller. Then the controller (if the request
is post) runs isValid($_POST).

This works fine I just wish there was a way to access the post variable from
the same $_POST array that is sent using isValid instead of passing
variables twice to the form object (model).


    public function getAccountCreateForm($postPass = null)
    {
        // Add a password form element
        $password = new Zend_Dojo_Form_Element_PasswordTextBox('password');
        $password->setLabel('Password:')
                 ->setRequired(true)
                 ->setTrim(true)
                 ->setInvalidMessage('Please provide a valid password');
        $form->addElement($password);
        
        // Add a confirm password form element
        $confirmPassword = new Zend_Dojo_Form_Element_PasswordTextBox(
                                                           
'confirmPassword');
        $confirmPassword->setLabel('Confirm Password:')
                 ->setRequired(true)
                 ->setTrim(true)
                 ->setInvalidMessage('Please provide a valid password')
                 ->addValidator('identical', 
                    true, 
                    array($postPass));
        $form->addElement($confirmPassword);
    }

-- 
View this message in context: 
http://www.nabble.com/Zend_Form---Identical-Validator-and-comparing-form-fields-tp21295103p21295103.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to