diff --git a/libraries/joomla/form/fields/list.php b/libraries/joomla/form/fields/list.php index bfe97948e496c..dc6e90dd8f1a4 100644 --- a/libraries/joomla/form/fields/list.php +++ b/libraries/joomla/form/fields/list.php @@ -45,6 +45,16 @@ protected function getInput() $attr .= $this->required ? ' required aria-required="true"' : ''; $attr .= $this->autofocus ? ' autofocus' : ''; + + foreach ($this->element->attributes() as $a => $b) + { + if(preg_match('(data-[a-zA-Z\-]+)', $a)) + { + $attr .= $this->element[$a] ? $a.'="'.(string) $this->element[$a].'"' : ''; + } + } + + // To avoid user's confusion, readonly="true" should imply disabled="true". if ((string) $this->readonly == '1' || (string) $this->readonly == 'true' || (string) $this->disabled == '1'|| (string) $this->disabled == 'true') {