Issues

ZF-8941: FormCheckbox renders hidden field with array element

Description

in a view:

$this->formCheckbox('example[index1]', 'Example1', $attribs); $this->formCheckbox('example[index2]', 'Example2', $attribs);

will incorrectly render the hidden field, although this is an array.

Comments

a better solution, somehow cleaner, might be to change, in the class Zend_View_Helper_FormCheckbox: if (!$disable && !strstr($name, '[]')) { to: if (!$disable && !strstr($name, ']')) {

another example of broken behaviour (code snippet): foreach ($images as $image) $this->formCheckbox('image_del[' . $image->id . ']', $image->id);

using "$this->formCheckbox('image_del[]', $image->id);" ain't an option, since it will render a image_del id in the form elements, over and over again, which also ain't valid html/xhtml