Commit 6da2605e authored by Carsten  Rose's avatar Carsten Rose
Browse files

#3832 / Dynamic Update und Radio buttons - leerer value ( '' ) kann nicht angewählt werden

AbstractbuildFrom.php: an empty value leads to a missing atrribute 'value'. Now the attribute 'value' is always generated, even if the string is empty. For Bootstrap Radio Buttons, an empty value looks bad. To fix it, a ' ' is now rendered.
parent efc2450a
......@@ -1909,7 +1909,7 @@ abstract class AbstractBuildForm {
for ($ii = 0; $ii < count($itemValue); $ii++) {
$classActive = '';
$attribute .= Support::doAttribute('value', $itemKey[$ii]);
$attribute .= Support::doAttribute('value', $itemKey[$ii], false); // Always set value, even to '' - #3832
$attribute .= Support::doAttribute('title', $formElement['tooltip']);
if ($itemKey[$ii] === $value) {
......@@ -1917,6 +1917,10 @@ abstract class AbstractBuildForm {
$classActive = ' active';
}
if ($itemValue[$ii] == '') { // In case the value is empty, the rendered button looks bad. Set '&nbsp;'.
$itemValue[$ii] = '&nbsp;';
}
$htmlElement = '<input ' . $attribute . '>' . $itemValue[$ii];
$htmlElement = Support::wrapTag("<label class='btn " . $formElement[FE_BUTTON_CLASS] . "$classActive'>", $htmlElement);
......@@ -1988,7 +1992,7 @@ abstract class AbstractBuildForm {
for ($ii = 0; $ii < count($itemValue); $ii++) {
$jj++;
$attribute .= Support::doAttribute('value', $itemKey[$ii]);
$attribute .= Support::doAttribute('value', $itemKey[$ii], false); // Always set value, even to '' - #3832
$attribute .= Support::doAttribute('title', $formElement['tooltip']);
if ($itemKey[$ii] === $value) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment