I learnt that I can set the ignore flag on a Zend_Form_Element so that it’s ignored when getting values etc.
I have
$this->addElement('submit', 'btnLogin', array(
'label' => 'Login',
'ignore' => true
));
But when I do
foreach ($this->getElements() as $elem) {
echo $elem->getName() . "<br />";
}
It stills includes the btnLogin
The
ignore-flag will only ensure that the form elementdoes not get ais not included when retrieving the form values on the form level (name-attribute effectively removing it from the posted form data$form->getValues()). You won’t get the element’s value when doing e.g.: