From db81f314256d6407f624a04fd8d9e7a815315dae Mon Sep 17 00:00:00 2001 From: El-Virus Date: Sun, 24 Jul 2022 15:34:16 +0200 Subject: [PATCH] Added option to hide list boxes. --- Core/Frameworks/Formal/Element/Listbox.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Core/Frameworks/Formal/Element/Listbox.php b/Core/Frameworks/Formal/Element/Listbox.php index f398965..be96724 100644 --- a/Core/Frameworks/Formal/Element/Listbox.php +++ b/Core/Frameworks/Formal/Element/Listbox.php @@ -33,6 +33,7 @@ class Listbox extends \Formal\Element { $inputclass = ""; $groupclass = ""; $placeholder = ""; + $onchange = ""; $value = $this->value(); $label = $this->option("label"); @@ -64,6 +65,10 @@ class Listbox extends \Formal\Element { $popover .= " data-content=\"" . htmlspecialchars($aPopover["content"]) . "\" "; } + if ($this->option("refreshonchange") === true) { + $onchange = " onchange=\"document.getElementsByTagName('form')[0].elements['refreshed'].value=1;document.getElementsByTagName('form')[0].submit();\" "; + } + $clientvalue = htmlspecialchars($value); $aRenderedOptions = []; @@ -92,7 +97,7 @@ class Listbox extends \Formal\Element {
- {$sRenderedOptions} {$helpblock}