ZF-1639: Zend_View_Helper_FormSelect and multiples

Issue Type: Improvement Created: 2007-06-27T10:11:18.000+0000 Last Updated: 2008-03-21T16:25:49.000+0000 Status: Resolved Fix version(s): - 1.5.0 (17/Mar/08)

Reporter: steve goodman (stevegoodman) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend_View

Related issues: - ZF-2230



Zend_View_Helper_FormSelect takes it upon itself to declare a select box as a multiple select box if the name of the control ends in '[]'. While most cases probably warrant this, I have run into an issue with this, and would like to request the ability to specify whether a select box is 'multiple' or not via a key in the $options array, something like array('multiple' => false).

The use case: I have a form where a user can generate n number of select boxes, each one named 'dataTypes[]'.The select boxes should only have one value be selectable, and when the form is submitted, $_POST['dataTypes'] should be an array containing each user-selected value, so I have a 1:1 ratio between generated select boxes and user input. Currently, when I use Zend_View::FormSelect to build these select boxes, they are all set to multiple, which is not allowed by my business logic. However, I don't have any way to alter this behavior other than modifying or extending the the Zend_View_Helper_FormSelect class itself.

Not a huge deal, but I think this should be configurable through the base class.


Posted by Bill Karwin (bkarwin) on 2007-06-27T10:32:22.000+0000

Assign to Matthew.

Posted by Matthew Weier O'Phinney (matthew) on 2007-11-26T16:39:04.000+0000

This goes along with ZF-1292 and and ZF-2230, and requires a bit of re-architecting to achieve. I will target it for the 1.1.0 release.

Posted by Matthew Weier O'Phinney (matthew) on 2008-02-13T08:35:48.000+0000

Fixed in trunk

Have you found an issue?

See the Overview section for more details.


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

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