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