checkboxes support classes

This commit is contained in:
Roland Gruber 2018-04-15 10:33:44 +02:00
parent 5b578cee53
commit 5d9beec96d
1 changed files with 5 additions and 1 deletions

View File

@ -1951,6 +1951,10 @@ class htmlInputCheckbox extends htmlElement {
if (!$this->isEnabled) { if (!$this->isEnabled) {
$disabled = ' disabled'; $disabled = ' disabled';
} }
$classes = ' ';
if (!empty($this->cssClasses)) {
$classes = ' class="' . implode(' ', $this->cssClasses) . '"';
}
// build Java script to show/hide depending fields // build Java script to show/hide depending fields
$onChange = ''; $onChange = '';
$script = ''; $script = '';
@ -2031,7 +2035,7 @@ class htmlInputCheckbox extends htmlElement {
if (!empty($onChange)) { if (!empty($onChange)) {
$onChange = ' onChange="' . $onChange . '"'; $onChange = ' onChange="' . $onChange . '"';
} }
echo '<input type="checkbox" id="' . $this->name . '" name="' . $this->name . '"' . $tabindexValue . $onChange . $checked . $disabled . '>'; echo '<input type="checkbox" id="' . $this->name . '" name="' . $this->name . '"' . $classes . $tabindexValue . $onChange . $checked . $disabled . '>';
echo $script; echo $script;
if ($this->transient) { if ($this->transient) {
return array(); return array();