Added option to hide list boxes.
This commit is contained in:
parent
9e43a17dec
commit
db81f31425
1 changed files with 6 additions and 1 deletions
|
@ -33,6 +33,7 @@ class Listbox extends \Formal\Element {
|
||||||
$inputclass = "";
|
$inputclass = "";
|
||||||
$groupclass = "";
|
$groupclass = "";
|
||||||
$placeholder = "";
|
$placeholder = "";
|
||||||
|
$onchange = "";
|
||||||
|
|
||||||
$value = $this->value();
|
$value = $this->value();
|
||||||
$label = $this->option("label");
|
$label = $this->option("label");
|
||||||
|
@ -64,6 +65,10 @@ class Listbox extends \Formal\Element {
|
||||||
$popover .= " data-content=\"" . htmlspecialchars($aPopover["content"]) . "\" ";
|
$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);
|
$clientvalue = htmlspecialchars($value);
|
||||||
|
|
||||||
$aRenderedOptions = [];
|
$aRenderedOptions = [];
|
||||||
|
@ -92,7 +97,7 @@ class Listbox extends \Formal\Element {
|
||||||
<div class="control-group{$groupclass}">
|
<div class="control-group{$groupclass}">
|
||||||
<label class="control-label" for="{$prop}">{$label}</label>
|
<label class="control-label" for="{$prop}">{$label}</label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<select class="{$inputclass}" id="{$prop}" name="data[{$prop}]"{$disabled}{$popover}>
|
<select class="{$inputclass}" id="{$prop}" name="data[{$prop}]"{$disabled}{$popover}{$onchange}>
|
||||||
{$sRenderedOptions}
|
{$sRenderedOptions}
|
||||||
</select>
|
</select>
|
||||||
{$helpblock}
|
{$helpblock}
|
||||||
|
|
Loading…
Reference in a new issue