Skip to content
Advertisement

Laravel – edit form updated checkbox value

I have a form created for editing a Trip. One field is ‘Public’ which is a boolean. When public is checked as true, I can’t get it to show and update on the edit form.

addTrip.blade.php

JavaScript

editTrip.blade.php

JavaScript

TripController

JavaScript

Advertisement

Answer

input type checkbox has the property checked. if you want to make it checked then you have to add the property.

JavaScript

use whatever value you have stored in your database instead of 1.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement