Show your form HTML code as I can't quite understand what is your problem.
<div class="row">
<div class="large-12 columns" >
<label>{{ $q->question }}</label>
@if ($q->choice_r1 != '')
{{ Form::radio('ans', $q->choice_r1, null, ['id'=>'y_id','class' => 'text-center', "name"=>"qst-".$q->id]) }} <label class="mTop-07 text-center"> {{ $q->choice_r1 }} </label>
@endif
@if ($q->choice_r2 != '')
{{ Form::radio('ans', $q->choice_r2, null, ['id'=>'n_id', 'class' => 'text-center', "name"=>"qst-".$q->id]) }} <label class="mTop-07 text-center"> {{ $q->choice_r2 }} </label>
@endif
@if ($q->choice_r3 != '')
{{ Form::radio('ans', $q->choice_r3, null, ['id'=>'n_id', 'class' => 'text-center', "name"=>"qst-".$q->id]) }} <label class="mTop-07 text-center"> {{ $q->choice_r3 }} </label>
@endif
@if ($q->choice_r4 != '')
{{ Form::radio('ans', $q->choice_r4, null, ['id'=>'n_id', 'class' => 'text-center', "name"=>"qst-".$q->id]) }} <label class="mTop-07 text-center"> {{ $q->choice_r4 }} </label>
@endif
@if ($q->choice_r5 != '')
{{ Form::radio('ans', $q->choice_r5, null, ['id'=>'n_id', 'class' => 'text-center', "name"=>"qst-".$q->id]) }} <label class="mTop-07 text-center"> {{ $q->choice_r5 }} </label>
@endif
<br>
</div>
</div>
@elseif ($q->type == "text")
<label>{{ $q->question }}</label>
{{ Form::text('answer_text', '', ["class"=>"inputField text-center size-16 h-3 radius", "name"=>"qst-".$q->id]) }}
@elseif ($q->type == "checkbox")
<label>{{ $q->question }}</label>
@if ($q->choice_cb1 != '')
{{ Form::checkbox('ans', $q->choice_cb1, null, ['id'=>'y_id','class' => 'text-center', "name"=>"qst-".$q->id]) }} <label class="mTop-07 text-center"> {{ $q->choice_cb1 }} </label>
@endif
@if ($q->choice_cb2 != '')
{{ Form::checkbox('ans', $q->choice_cb2, null, ['id'=>'n_id', 'class' => 'text-center', "name"=>"qst-".$q->id]) }} <label class="mTop-07 text-center"> {{ $q->choice_cb2 }} </label>
@endif
@if ($q->choice_cb3 != '')
{{ Form::checkbox('ans', $q->choice_cb3, null, ['id'=>'n_id', 'class' => 'text-center', "name"=>"qst-".$q->id]) }} <label class="mTop-07 text-center"> {{ $q->choice_cb3 }} </label>
@endif
@if ($q->choice_cb4 != '')
{{ Form::checkbox('ans', $q->choice_cb4, null, ['id'=>'n_id', 'class' => 'text-center', "name"=>"qst-".$q->id]) }} <label class="mTop-07 text-center"> {{ $q->choice_cb4 }} </label>
@endif
@if ($q->choice_cb5 != '')
{{ Form::checkbox('ans', $q->choice_cb5, null, ['id'=>'n_id', 'class' => 'text-center', "name"=>"qst-".$q->id]) }} <label class="mTop-07 text-center"> {{ $q->choice_cb5 }} </label>
@endif
<br>
@endif
<br>
@endforeach
{{ Form::submit('Submit', ["class"=>"nsi-btn button small radius right"]) }}
</div>
What exactly is it that you want to do ? From my point of view it looks like you're trying to save the data of multiple checkboxes ?
If you litterally mean that you want to save more than 1 value of a checkbox then I have no idea because I'm pretty sure a checkbox doesn't even contain a value.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community