I have three radio buttons but they not work properly. when I click one, the other one blink and then all of them seem unchecked. livewire model changes correctly but buttons mess it up.
<div class="mt-4">
<label class="block mb-6">
<input type="radio" name="package" class="custom-radio mr-2" wire:model="package" value="x" />
x
</label>
<label class="block mb-6">
<input type="radio" name="package" class="custom-radio mr-2" wire:model="package" value="y" />
y
</label>
<label class="block mb-6">
<input type="radio" name="package" class="custom-radio mr-2" wire:model="package" value="z" />
z
</label>
</div>
2
Answers
You can archieve the desired behavior by using the following code,
checked
attribute should be usedYou have to give diffrent Id’s to all radio buttons. Now all radio buttons having No ID, so it is not selecting proper one
Try below :