ZF-8941: FormCheckbox renders hidden field with array element

Issue Type: Patch Created: 2010-01-26T11:12:29.000+0000 Last Updated: 2012-11-20T21:37:44.000+0000 Status: Open Fix version(s): Reporter: Pedro Pinto (_pn_boy) Assignee: None Tags: - Zend_View

Related issues: Attachments: - ZF-8941.patch


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.


Posted by Pedro Pinto (_pn_boy) on 2010-05-07T13:30:33.000+0000

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

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.