On 27/02/2008, at 5:16 PM, love Postfix as we do? wrote:

Hi,

How to remove <dt><dd> for hidden element type from rendered form (Zend_Form)?

thanks


<form enctype="application/x-www-form-urlencoded"
action="anggota/save" method="post"><dl class="zend_form">
<dt></dt>
<dd>
<input type="hidden" name="id" value="2" id="id" /></dd>
<dt></dt>
<dd>
<input type="hidden" name="keluarga_id" value="3" id="keluarga_id" / ></dd>
<dt><label for="nomor">Nomor</label></dt>

<dd>
<input type="text" name="nomor" id="nomor" value="1" /></dd>
<dt><label for="nama_anggota">Nama_anggota</label></dt>
<dd>

I reported this one in the issue tracker:

http://framework.zend.com/issues/browse/ZF-2718

A quickie that I'm using after I've setup my non-hidden elements is...

$hiddenElement = new Zend_Form_Element_Hidden('hiddenElement');
$hiddenElement->clearDecorators();
$hiddenElement->addDecorators(array(
    array('ViewHelper'),    // element's view helper
));
$this->addElement($hiddenElement);

...which unfortunately produces invalid markup but at least hides the field for now.

Nick

Reply via email to