Choices icon indicating copy to clipboard operation
Choices copied to clipboard

Returns a single item in multiple selects

Open mokhosh opened this issue 4 years ago • 1 comments

Something similar to the last issue. But this time I'm getting only one of the selected items. But when I use regular old ugly multiple select, I get an array.

mokhosh avatar Apr 04 '20 18:04 mokhosh

@mokhosh

Bit late, but I fixed this by updating name attribute on the select element.

Before:

<select name="products" multiple ... >

Form submission:

Array
(
    [products] => Item 3
)

After:

<select name="products[]" multiple ... >

Form submission:

Array
(
    [products] => Array
        (
            [0] => Item 1
            [1] => Item 3
        )

)

jameskirkby avatar Oct 05 '20 16:10 jameskirkby