Skip to content
This repository was archived by the owner on Mar 18, 2025. It is now read-only.

Commit 9d2508a

Browse files
committed
Provide better support for multiple select in non-livewire forms - #34
1 parent d39e839 commit 9d2508a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

resources/views/components/inputs/custom-select.blade.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,12 @@ class="custom-select__menu py-1 overflow-auto text-base leading-6 rounded-md sha
7878
@include('form-components::partials.custom-select-button')
7979

8080
@unless ($attributes->hasStartsWith('wire:model'))
81-
<input type="hidden" x-bind:value="JSON.stringify(value)" name="{{ $name }}">
81+
@if ($multiple)
82+
<template x-for="item in value">
83+
<input type="hidden" x-bind:value="item" name="{{ $name }}[]">
84+
</template>
85+
@else
86+
<input type="hidden" x-bind:value="value" name="{{ $name }}">
87+
@endif
8288
@endif
8389
</div>

0 commit comments

Comments
 (0)