Radio button with bootstrap4

Hi.

In the bootstrap4, individual radio buttons are surrounded by <div class="form-check"> like

<div class="form-check">
	<label class="form-check-label"><input class="form-check-input" type="radio" name="n1" id="id_n1" value="op1" checked>op1</label>
</div>
<div class="form-check">
	<label class="form-check-label"><input class="form-check-input" type="radio" name="n2" id="id_n2" value="op2" checked>op2</label>
</div>

.
But when I use formRow(), the individual radio buttons are connected to each other in the output like

<label class="form-check-label"><input class="form-check-input" type="radio" name="n1" value="op1" checked>op1</label>
<label class="form-check-label"><input class="form-check-input" type="radio" name="n2" value="op2">op2</label>

Is there any option to enclose individual tags by <div class="form-check"> using Element\Radio?

Hello and welcome to our forums! :smiley:

The first thing that comes to mind:

<?php
$html = $this->formRadio()
    ->setSeparator('</div><div class="form-check">')
    ->render($element);
?>
<div class="form-check"><?= $html ?></div>
1 Like

GREAT!!! :joy:
It works fine, thank you for your advice!