Discussion:
Zend_Form: hidden element
love Postfix as we do?
17 years ago
Permalink
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>
Nick Lo
17 years ago
Permalink
...
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
monk.e.boy
15 years ago
Permalink
Thank you.

I fail to understand why this isn't set by default. I read and understood
the bug issues, but I still think some sort of solution that helps 99.99% of
people must be pretty easy (hint: we don't nest forms) ;)

Thanks again,

monk.e.boy
--
View this message in context: http://n4.nabble.com/Zend-Form-hidden-element-tp648795p2016679.html
Sent from the Zend Framework mailing list archive at Nabble.com.
Loading...