Do you need it to be invisible but submitted with the post data? Try making
it a hidden input field:
$this->addElement('hidden', 'myfield', array(/* ... */));

Or you can remove the element completely if you don't need it to be
submitted:

$form = new MyForm();
$form->removeElement('myfield');

Or, like you said, you can use CSS to make them invisible with display:none.

--
Hector


On Mon, Aug 10, 2009 at 8:14 AM, flow <[email protected]> wrote:

>
> Hi,
>
> I want to hide a zend_form_element and I was wondering that there is no
> visible-attribute or something like that.
> Of course I can give the element a class and hide it via CSS, but is this
> the "correct" way?
> I think It would be better to hide the element in the init of the form so
> that it doesn't get rendered.
>
> Thanks for your help.
> --
> View this message in context:
> http://www.nabble.com/Hide-a-Zend_Form_Element-tp24901620p24901620.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>
>

Reply via email to