Fix preselection when key is '0'
This commit is contained in:
parent
528bfca690
commit
5bcce53e40
@ -6167,7 +6167,6 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Try also magic suggest
|
// Try also magic suggest
|
||||||
|
|
||||||
$out .= '<select id="'.$htmlname.'" class="multiselect'.($morecss?' '.$morecss:'').'" multiple name="'.$htmlname.'[]"'.($moreattrib?' '.$moreattrib:'').($width?' style="width: '.(preg_match('/%/', $width)?$width:$width.'px').'"':'').'>'."\n";
|
$out .= '<select id="'.$htmlname.'" class="multiselect'.($morecss?' '.$morecss:'').'" multiple name="'.$htmlname.'[]"'.($moreattrib?' '.$moreattrib:'').($width?' style="width: '.(preg_match('/%/', $width)?$width:$width.'px').'"':'').'>'."\n";
|
||||||
if (is_array($array) && ! empty($array))
|
if (is_array($array) && ! empty($array))
|
||||||
{
|
{
|
||||||
@ -6178,7 +6177,7 @@ class Form
|
|||||||
foreach ($array as $key => $value)
|
foreach ($array as $key => $value)
|
||||||
{
|
{
|
||||||
$out.= '<option value="'.$key.'"';
|
$out.= '<option value="'.$key.'"';
|
||||||
if (is_array($selected) && ! empty($selected) && in_array($key, $selected) && ((string) $key != ''))
|
if (is_array($selected) && ! empty($selected) && in_array((string) $key, $selected) && ((string) $key != ''))
|
||||||
{
|
{
|
||||||
$out.= ' selected';
|
$out.= ' selected';
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user