Open GoogleCodeExporter opened 8 years ago
Hi
I replaced my render file with the following to make it work:
public function render() {
if(isset($this->_attributes["value"])) {
if(!is_array($this->_attributes["value"]))
$this->_attributes["value"] = array($this->_attributes["value"]);
}
else
$this->_attributes["value"] = array();
if( isset($this->_attributes["multiple"]) && $this->_attributes["multiple"] == true)
{
$multiple=true;
}
if($multiple && substr($this->_attributes["name"], -2) != "[]")
$this->_attributes["name"] .= "[]";
echo '<select', $this->getAttributes(array("value", "selected")), '>';
$selected = false;
foreach($this->options as $value => $text) {
$value = $this->getOptionValue($value);
echo '<option value="', $this->filter($value), '"';
if((!$selected || $multiple) && in_array($value, $this->_attributes["value"])) {
echo ' selected="selected"';
$selected = true;
}
echo '>', $text, '</option>';
}
echo '</select>';
}
Original comment by jamil.ab...@qualizone-lb.com
on 4 May 2015 at 6:09
Original issue reported on code.google.com by
docon...@gmail.com
on 13 Aug 2013 at 11:53