Level 75
There are no names or id's. But you could build up a session array and use it for final usage.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I need help in making the checkbox checked persisent in building a quiz app with one question per page.
@foreach ($questions as $question)
<p>{{ $question->question }}</p>
<ul>
<li>
{{-- <form action="" method="post"> --}}
<input type="checkbox" name="" id="">
{{-- </form> --}}
{{$question->option_a}}
</li>
<li>
{{-- <form action="" method="post"> --}}
<input type="checkbox" name="" id="">
{{-- </form> --}}
{{$question->option_b}}
</li>
<li>
{{-- <form action="" method="post"> --}}
<input type="checkbox" name="" id="">
{{-- </form> --}}
{{$question->option_c}}
</li>
<li>
{{-- <form action="" method="post"> --}}
<input type="checkbox" name="" id="">
{{-- </form> --}}
{{$question->option_d}}
</li>
</ul>
@endforeach
public function index()
{
//
$questions = Question::paginate(1);
return view('question', compact('questions'));
}
There are no names or id's. But you could build up a session array and use it for final usage.
Please or to participate in this conversation.