I have 5 grouped radio buttons, then the values of the radio buttons are dynamic, foreach and fetched from the database.
But the problem is the auto switching radio button, what do you think about it?
Livewire Version : 2.x
Laravel Version : 8.x
screenshots or code examples:
Controller
class Example {
public $answer = [];
}
Blade
<li><input type="radio" wire:model='answer.{{ $item->id }}' value='{{$item->key}}' name="answer.{{ $item->id }}"> <span style="margin-left:10px;">A. {{ $item->opsi_a }}</span></li>
<li><input type="radio" wire:model='answer.{{ $item->id }}' value='{{$item->key}}' name="answer.{{ $item->id }}"> <span style="margin-left:10px;">B. {{ $item->opsi_b }}</span></li>
<li><input type="radio" wire:model='answer.{{ $item->id }}' value='{{$item->key}}' name="answer.{{ $item->id }}"> <span style="margin-left:10px;">C. {{ $item->opsi_c }}</span></li>