merlin
merlin

Reputation: 2927

jQuery Mobile: Multiple select menu transmits only single value

I am following the jquery mobile ui "muliple select forms" with the goal of having the possibilty to select multiple values over post form. http://demos.jquerymobile.com/1.4.5/selectmenu-custom/

The relevant part of my code looks like this:

<select name="attributes[27]" id="attributes[27]" multiple="multiple" data-native-menu="false" data-mini="true">
    <option>auswählen</option>
    <option value="315" >Drehbare Lünette</option>  
    <option value="307" >Edelsteinbesatz</option>
    <option value="301" >Genfer Siegel</option>
</select>

The form will post this uppon selecting multiple values:

Array
(
    [27] => 301
)

How can I transfer multiple values? My code looks just as the one in the example.

Upvotes: 0

Views: 74

Answers (1)

merlin
merlin

Reputation: 2927

Found the solution to the problem within another posting: jQueryMobile: Multiple-Select sent all values to server

The name tag needs to have [] at the end (<select name="attributes[27][]" ..). This is missing within the jQuery Mobile docs.

Upvotes: 2

Related Questions