Skip to content

Commit a003fee

Browse files
authored
Merge pull request #9 from vint47/master
Fix checkboxgroup for unchecked submit
2 parents e9ab53f + d75ba43 commit a003fee

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/Form/Element/CheckboxGroup.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,9 @@ public function setOptions($options = [])
3535

3636
return $this;
3737
}
38+
39+
public function value()
40+
{
41+
return $this->value ? : [];
42+
}
3843
}

src/resources/views/default/element/checkbox-group.blade.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<div class="form__element form__element_type_checkbox-group @if($error) form__element_error @endif {{$class}}">
22
<label class="form__label">{{ $label }}</label>
33
<div class="form__element-container">
4+
<input type="hidden" value="" name="{{ $elementName }}">
45
@foreach ($options as $key => $label)
56
<label>
67
<input @foreach($attributes as $attributeName => $attributeValue) {{ $attributeName }}="{{ $attributeValue }}" @endforeach type="checkbox"

0 commit comments

Comments
 (0)