Closed yannrobin closed 6 years ago
Hello
I am using this to generate my checkbox :
<?= Former::checkbox( 'checkbox' ) ->label( ' ' ) ->text( 'Primary Infrastructure' ) ->checked_value( 1 ) ->unchecked_value( 0 ) ->check() ?>
So my checkbox is checked by default, if I uncheck it and submit the form with a rules error from an other input I will be redirected to the form with the error message but the checkbox will be checked while it was uncheck before submit.
Am i doing something wrong or its an issue ?
Thanks
Fixed by changing in the following the config/former.php
'push_checkboxes' => true, 'unchecked_value' => 0,
And adding ->value(1) to the checkbox
Hello
I am using this to generate my checkbox :
So my checkbox is checked by default, if I uncheck it and submit the form with a rules error from an other input I will be redirected to the form with the error message but the checkbox will be checked while it was uncheck before submit.
Am i doing something wrong or its an issue ?
Thanks