mardi 29 septembre 2020

Laravel Blade - How to make checkbox stay checked after submit

I want to create a feature to filter data. I use the checkbox to do this. But I want when the checkbox is selected and then the user submits to filter the data, the previously selected checkbox remains selected.

i tried to do it like this but it didn't work

<input type="checkbox" id="ac" name="ac" value="ac" @if(old('ac')) checked @endif>

my form method to submit this is GET.




Aucun commentaire:

Enregistrer un commentaire