# Radio button with bootstrap4

**URL:** <https://discourse.laminas.dev/t/radio-button-with-bootstrap4/2133>\
**Category:** Components & MVC\
**Tags:** laminas-form\
**Created:** [February 26, 2021, 12:17pm UTC](https://discourse.laminas.dev/t/radio-button-with-bootstrap4/2133 "2021-02-26T12:17:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![smj320](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/smj320/32/914_2.png) [@smj320](https://discourse.laminas.dev/u/smj320)\
**Post date:** [February 26, 2021, 12:17pm UTC](https://discourse.laminas.dev/t/radio-button-with-bootstrap4/2133/1 "2021-02-26T12:17:29Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![froschdesign](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/froschdesign/32/38_2.png) [@froschdesign](https://discourse.laminas.dev/u/froschdesign)\
**Post date:** [February 26, 2021, 12:50pm UTC](https://discourse.laminas.dev/t/radio-button-with-bootstrap4/2133/2 "2021-02-26T12:50:08Z")

</div>

Hello and welcome to our forums! 😃

> [@smj320](#):
>
> Is there any option to enclose individual tags by `<div class="form-check">` using Element\Radio?

The first thing that comes to mind:

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

```

> <https://github.com/laminas/laminas-form/blob/a028e927ed1b07a98e43c22d5e7cac796f7a0e9d/src/View/Helper/FormMultiCheckbox.php#L342-L352>

---

<div class="post-metadata">

**Author:** ![smj320](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/smj320/32/914_2.png) [@smj320](https://discourse.laminas.dev/u/smj320)\
**Post date:** [February 26, 2021, 1:39pm UTC](https://discourse.laminas.dev/t/radio-button-with-bootstrap4/2133/3 "2021-02-26T13:39:29Z")

</div>

GREAT!!! 😂  
It works fine, thank you for your advice!
