\n") { $doc = Zend_Registry::get('doc'); $doc->addScript('js/lib/form-order-select.js'); $doc->addInitFunction('initFormOrderSelect', [$name]); $hiddenName = ($attribs['multiple']) ? $name . '[]' : $name; $hiddenId = $name . '-hidden'; $selectName = '_' . $name; $values = []; foreach ($options as $optionKey => $option) { if (is_array($option)) { // is optgroup $values = array_merge($values, array_keys($option)); } else { $values[] = $optionKey; } } $html = $this->formSelect( $hiddenName, $values, ['style' => 'visibility:hidden; width:1px; height:1px; margin:0; padding:0;', 'id' => $hiddenId], $options ); $html .= $this->formSelect($selectName, $value, $attribs, $options, $listsep); $html .= '
' . '   ' . '' . '
'; return $html; } }