Radio button in the label label in the blade Laravel

How to make this code in laravel blade

<label class="radio" for="penyakit-0">
    <input name="penyakit" id="penyakit-0" value="Asma" type="radio">
    Asma
</label>

I tried many ways so that the radio button could be clicked on its text using the blade syntax, but still nothing worked.

This is my syntax for this HTML:

<label class="radio" for="penyakit-0">
    {{ Form::radio('penyakit', 'Asma', array('id'=>'penyakit-0')) }} 
</label>
+4
source share
1 answer

Try:

{{ Form::label('penyakit-0', 'Asma') }}
{{ Form::radio('penyakit', 'Asma', false, array('id'=>'penyakit-0')) }}

Edit:

As Phil Gifford pointed out above, this Laravel blade snippet does not give an element labelwith an inline element input.

Unfortunately (or fortunately) in design Laravel for some reason chose an alternative design using the attribute for.

+11

Source: https://habr.com/ru/post/1546773/


All Articles