"ma" /> "ma" /> "ma"/>

Choices-js select list is returning an array

137 Views Asked by At

i'm using choices-js select list and it's value is being an array like this

array:1 [▼ // app\Http\Livewire\Admin\Users\UserForm.php:56
  "value" => "male"
]

and this is my select list

<select class="form-control" name='gender' id="choices-gender">
    <option value="">Seç</option>
    <option value="male">Erkek</option>
    <option value="female">Kadın</option>
</select>
<script src="/assets/js/plugins/choices.min.js"></script>
<script>
    const gender = document.getElementById('choices-gender');
    if (gender) {
        const example = new Choices(gender);
    }
</script>

I don't want the value to be an array, how can just get the value?

0

There are 0 best solutions below