Skip to content

Commit

Permalink
Update checkbox-inline.phtml
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
magicsunday authored Dec 27, 2023
1 parent a837a59 commit d36dc9b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions resources/views/components/checkbox-inline.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ declare(strict_types=1);
* @var string $label
* @var string $name
* @var string $value
* @var string $unchecked
*/

?>

<div class="form-check form-check-inline">
<input type="hidden" value="<?= e($unchecked) ?>" name="<?= e($name) ?>">
<input type="checkbox" class="form-check-input"
name="<?= e($name) ?>"
id="<?= e($id ?? $name . '-' . ($value ?? '1')) ?>"
Expand Down

0 comments on commit d36dc9b

Please sign in to comment.