How so you get the multi-select dropdown results?

Retrieve multiple selected values from a dynamic multi-select dropdown.

Overview

The form data only shows a single value because the dropdown's name attribute is not formatted as an array.
Modify the dropdown's name by appending square brackets (e.g., name="dropdown[]") to ensure submitted data is processed as an array, resulting in a comma-separated list of selections.

Answered
Ma MainsailSoftware 21 Feb, 2015
I am using a Multi-Select Dropdown that is dynamically loaded from a DB table. The Multi-Select shows the correct items and allows multiple selections of items.

When I select multiple items in the list and Submit, in Debug $form->data only shows a single selected value. I would have expected to see an array or comma separated list.

How do I get the the full list of selected items?

I have not been able to find any examples or posts that make sense to me.
Gr GreyHead 22 Feb, 2015
1 Likes
Hi MainsailSoftware,

You need to give the Multi-Select DropDown an array name with [] at the end e.g. drop_down99[]

Bob
Ma MainsailSoftware 22 Feb, 2015
Answer
Perfect Bob...

Now I get a comma separated list. I should have thought of trying that!

Jim
This topic is locked and no more replies can be posted.