hello,

I want to set a value to an element after submitting the form.
I need it because one element is disable and when there are errors on the
form the element has a null value.

this code doesn't works, value = null :

class App_Form extends Zend_Form
{
        public function init()
        {
            $last_name = $this->createElement('text', 'last_name')
            $last_name->setAttrib('disable', true);
            $last_name->setValue('testsamy');

            .............
            
            return $this;
        }
}

this code works, value = test:

class App_Form extends Zend_Form
{
        public function init()
        {
            $last_name = $this->createElement('text', 'last_name')
            $last_name->setAttrib('disable', true);
            $last_name->setValue('testsamy');

            .............
            
            return $this;
        }

        public function isValid($data)
        {
            $valid = parent::isValid($data);
            
            $this->getElement('last_name')->setValue('test');
            
            return $valid;
        }
}

How can i do without overloading the method isValid ?

Thanks

-- 
View this message in context: 
http://www.nabble.com/Zend_Form-setValue-tp23770977p23770977.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to