Support the ongoing development of Laravel.io →
posted 10 years ago
Forms

I have a some unchecked and some checked checkboxes in my View. Displaying properly with value set to 1 if checked and value set to 0 if unchecked. But if I change an unchecked to a checked one and then try and save it with ~~~ Input::all() ~~~ then I still only get the old value which was 0.

How does Laravel know that a checkbox has been changed to a checked one? It seems to be getting the value of the formerly unchecked box which is 0 when submitted. Do I have to use Javascript to change the value to 1 before submitting to the Laravel Controller?

TY!

Last updated 3 years ago.
0

Sign in to participate in this thread!

PHPverse

Your banner here too?

vkimura vkimura Joined 5 Aug 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.