Wrap selection group input in label

This commit is contained in:
Saophalkun Ponlu 2017-04-26 13:54:06 +12:00
parent 5a7c6d4f60
commit 68041f4265
2 changed files with 2 additions and 10 deletions

View File

@ -101,17 +101,9 @@ class SelectionGroup extends CompositeField
'name' => $this->name,
'value' => $item->getValue(),
'checked' => $checked,
'aria-labelledby' => "title-{$itemID}",
)
)),
"RadioLabel" => DBField::create_field('HTMLFragment', FormField::create_tag(
'label',
array(
'id' => "title-{$itemID}",
'for' => $itemID
),
$item->getTitle()
)),
"RadioLabel" => $item->getTitle(),
"Selected" => $firstSelected,
);
$newItems[] = $item->customise($extra);

View File

@ -13,7 +13,7 @@
<ul class="SelectionGroup<% if extraClass %> $extraClass<% end_if %>">
<% loop $FieldSet %>
<li$Selected>
{$RadioButton}{$RadioLabel}
<label>{$RadioButton} {$RadioLabel}</label>
<% if $FieldList %>
$FieldHolder
<% end_if %>