Assign attributes to form elements

Posted 11 months ago by JokersMild85

I asked this question a couple of days ago but the answers I received did not resolve my problem. I am trying to assign attributes to form elements, namely an ID attribute to my form checkboxes. When I attempt to do this, all it does is set all the checkboxes in my form to checked. Any thoughts why this is happening and how to successfully assign my checkboxes an ID attribute?

@foreach($exercise_type->exercises as $exercise)

    {!! Form::label('exercise_name', $exercise->exercise_name) !!}
    {!! Form::checkbox( 'exercise[]', '{$exercise->id}_{$exercise->exercise_type_id}_{$exercise->exercise_name}', ['id' => '{$exercise->exercise_name}'] ) !!}
    </br>

@endforeach

Please sign in or create an account to participate in this conversation.

Laracasts Mascot

Hi, Have We Met Yet?

Did you know that, in addition to the forum, Laracasts includes well over 1000 lessons on modern web development? All for the price of one lunch out per month.

Sign Me Up

Channels

Reply to

Use Markdown with GitHub-flavored code blocks.