vendredi 10 mai 2019

Make a checkbox unique in a table row

I have an isActive column where a checkbox is dynamically generated within a foreach loop using php within Laravel. The column is in a table with some rows and each row has it's own unique id. Columns(Name, Address, info, info, Active) I've done some research but can't seem to find a solution. I want to make the checkbox unique and somehow want to append the id to the checkbox so I can grab the onchange state of the checkbox with javascript, because later I'm going to pass that value to the database without pressing a submit button. Thanks in advance.

{!! Form::checkbox('is_active', old('is_active'), old('is_active'), ['id' => 'is_active', "class"=>"form-control switch-input".($errors->has('is_active')?" is-invalid":"")]) !!}




Aucun commentaire:

Enregistrer un commentaire