Quantcast
Channel: Editor — DataTables forums
Viewing all articles
Browse latest Browse all 3744

How to save multiple values with plugin select2 as one field in database

$
0
0

I've got the following js code to select multiple options.

{
                "label": "Bodemvocht:",
                "name": "bodemvocht",
                "type": "select2",
                "options": [
                     { "label": "", "value": "" },
                     { "label": "Droog", "value": "Droog" },
                     { "label": "Vochtig", "value": "Vochtig" },
                     { "label": "Nat", "value": "Nat" },
                     { "label": "Geen voorkeur", "value": "Geen voorkeur" }
                ],
                "opts": {
               "placeholder": "Selecteer vochtigheid",
               "multiple": "multiple",
               "separator": ";",
               "allowClear": true
                }

But when saving this I get an error (Array to string conversion) and only the text 'Array' is saved in the database. How to solve this properly?

Thanks for your help!


Viewing all articles
Browse latest Browse all 3744

Trending Articles