diff --git a/layouts/joomla/form/field/radio/switcher.php b/layouts/joomla/form/field/radio/switcher.php index fea4b91a2d011..26a8b80c47923 100644 --- a/layouts/joomla/form/field/radio/switcher.php +++ b/layouts/joomla/form/field/radio/switcher.php @@ -69,8 +69,17 @@ $option) : ?> value == $value) ? 'checked="checked"' : ''; - $active = ((string) $option->value == $value) ? 'class="active"' : ''; + if (is_numeric($option->value)) + { + $checked = ((int) $option->value == $value) ? 'checked="checked"' : ''; + $active = ((int) $option->value == $value) ? 'class="active"' : ''; + } + else + { + $checked = ((string) $option->value == $value) ? 'checked="checked"' : ''; + $active = ((string) $option->value == $value) ? 'class="active"' : ''; + } + $oid = $id . $i; $ovalue = htmlspecialchars($option->value, ENT_COMPAT, 'UTF-8'); $attributes = array_filter(array($checked, $active, null));