In my project, I am required to have many drop-down fields with array-notated names, like so:
<select name="language[]">...</select>
<select name="language[]">...</select>
<select name="language[]">...</select>
Since I need to render Zend's formSelect view helper for it, I thought it was as simple as doing:
for($i = 0; $i < 3; $++){
echo $this->formSelect('language[]', $this->languages[$i],
$this->attribs[$i],
$this->languageOptions[$i]);
}
But I was wrong: Instead of rendering them as regular drop-down fields, Zend decides to be a smarty-pant and render them as multiple-select fields, instead.
I understand the thinking behind this behavior, but it just so happens that it the help formSelect provides is too much for my needs.
Now, I can amend it with using JavaScript to remove the multiple="multiple" attribute to transform them to regular drop-downs...
But out of curiosity, is there a way to make formSelect render these elements as regular drop-down fields, other than modifying its underlying code?