Zend Framework: How do I remove the decorators on a Zend Form Hidden Element? -


I'm trying to remove the default decorator on a hidden form element. By default, hidden elements are displayed as follows:

   

I do not want to hide my hidden element on my page. I want to remove all default decorators, so the ones I'm living with is the input tag.

  & lt; Input type = "hidden" name = "foobar" value = "1" id = "foobar" & gt;  

How can I get it?

For hidden fields only one decorator is required - see Helper:

  $ field = new Zend_Form_Element_Hidden ('id'); $ Field- & gt; SetDecorators (array ('ViewHelper'));  

This DT-DD will render only the input field without the wrapper and label.


Comments