-- Holger Lampe <[EMAIL PROTECTED]> wrote
(on Tuesday, 01 April 2008, 04:36 PM +0200):
> Other view form helpers check for a set XHTML doctype.
> FormHidden depends on the _hidden function in the FormElement class,
> which does not check the doctype.
>
> So there defenitly is a inconsistentcy.
> I think this is something for the tracker
As noted in a previous response, this is already in the tracker:
http://framework.zend.com/issues/browse/ZF-2958
> You can overcome this problem by setting the doctype in your bootstrap
> or a plugin but not in a view script.
>
> Cheers,
> Holger
>
>
> -----Original Message-----
> From: Friedhelm Betz [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, April 01, 2008 3:58 PM
> To: [email protected]
> Subject: [fw-general] Zend_Form: hidden fields
>
> Hi,
>
> Newbie question about hidden fields default rendering (ZF 1.5.0).
>
> My simple, standalone form:
>
> <?php
> require_once('Zend/Loader.php');
> Zend_Loader::registerAutoload();
> $form = new Zend_Form();
> $form->setAction('foo.php');
> $form->addElement('hidden', 'foo', array('values' => 'foobar'))
> ->addElement('text', 'username', array('label' => 'username'))
> ->addElement('password', 'password', array('label' => 'password'))
> ->addElement('submit', 'login');
> $form->setView(new Zend_View());
> echo $form;
> ?>
>
> The hidden field renders with self-closing tag:
> <input type="hidden" name="foo" value="" values="foobar" id="foo" />
>
> other fields render without self-closing tag (for example):
> <input type="text" name="username" id="username" value="">
>
> This happens also with Zend_Form_Element_Hash.
>
> Is this expected behavior? At least, it seems inconsistent to me.
>
> Thanks,
> Friedhelm
>
>
--
Matthew Weier O'Phinney
PHP Developer | [EMAIL PROTECTED]
Zend - The PHP Company | http://www.zend.com/