Support the ongoing development of Laravel.io →
posted 9 years ago
Input
Last updated 2 years ago.
0

Show your form HTML code as I can't quite understand what is your problem.

0
<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>
0

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.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

encry2024 encry2024 Joined 2 Dec 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.