Skip to content

Commit 3893e47

Browse files
authored
fix default value for select box (#4)
1 parent 00d07e3 commit 3893e47

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Gustiawan/FormBuilder/views/components/bootstrap/fields/select.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<select name="{{ $field['name'] }}" id="{{ $field['name'] }}" class="form-control" {{ $field['required'] ? "required" : "" }}>
2-
<option>Select</option>
2+
<option value="">Select</option>
33
@foreach($field['choices'] as $value => $choice)
44
<option value="{{ $value }}" {{ (old($field['name']) ?? $field['value']) == $value ? "selected" : "" }} >{{ $choice }}</option>
55
@endforeach

src/Gustiawan/FormBuilder/views/components/tailwind/fields/select.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<select name="{{ $field['name'] }}" class="mt-2 p-2 form-select w-full border" {{ $field['required'] ? "required" : "" }}>
2-
<option>Select</option>
2+
<option value="">Select</option>
33
@foreach($field['choices'] as $value => $choice)
44
<option value="{{ $value }}" {{ (old($field['name']) ?? $field['value']) == $value ? "selected" : "" }} >{{ $choice }}</option>
55
@endforeach

0 commit comments

Comments
 (0)