Skip to content

Commit c0cc34d

Browse files
committed
Update checkbox.phtml
Currently the Checkbox component cannot be properly used to save empty (unchecked status) settings. A hidden element is missing here, which is assigned the unchecked value.
1 parent 95621db commit c0cc34d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

resources/views/components/checkbox.phtml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@ declare(strict_types=1);
99
* @var string $label
1010
* @var string $name
1111
* @var string|null $value
12+
* @var string $unchecked
1213
*/
1314

1415
?>
1516

1617
<div class="form-check">
18+
<input type="hidden" value="<?= e($unchecked) ?>" name="<?= e($name) ?>">
1719
<input type="checkbox" class="form-check-input"
1820
name="<?= e($name) ?>"
1921
id="<?= e($id ?? $name . '-' . ($value ?? '1')) ?>"

0 commit comments

Comments
 (0)