Make sure you have a setter for the element, in your case public function setId($id) . The Zend_Form constructor checks if the setter method exists for the property, if it exists, it is called, otherwise it sets the form attribute, see setAttrib($key, $value) .
The end result will be something like this
class Application_Form_YourForm extends Zend_Form { protected $_id = null; public function setId($id){ $this->_id = $id; }
source share