From e6dd937f32f0ad2af405c708b9914d5aeec912bb Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Thu, 25 May 2017 09:49:05 +0200 Subject: [PATCH] fix for select with empty value --- lam/lib/html.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lam/lib/html.inc b/lam/lib/html.inc index f4546b4f..a04f3a9b 100644 --- a/lam/lib/html.inc +++ b/lam/lib/html.inc @@ -1273,13 +1273,13 @@ class htmlSelect extends htmlElement { foreach ($elements as $key => $value) { $selected = ''; if ($this->hasDescriptiveElements) { - if (in_array($value, $this->selectedElements)) { + if (in_array($value, $this->selectedElements) || (empty($this->selectedElements) && empty($value))) { $selected = ' selected'; } echo "\n"; } else { - if (in_array($value, $this->selectedElements)) { + if (in_array($value, $this->selectedElements) || (empty($this->selectedElements) && empty($value))) { $selected = ' selected'; } echo "" . htmlspecialchars($value) . "\n";