Multiple Select Insert to DB

Hi Guys,

I’ve got a form which is submitting fine however I’ve added a “multiple select” into it. The problem i’ve got is that if i select multiple values from the list it only sends the last clicked value to the database (it doesn’t add all of them)

I was wondering whether it might be somehow possible in wappler to add all of the selected values and separate them by commas (eg If Option 1 & Option 2 are selected) this is what is inserted: Option 1, Option2

Hope that makes sense?

Thanks in advance

Ben

Difficult to see what you have at the moment and why it does not work.

As a starter, please have a look at https://www.dmxzone.com/support/22124/topic/61806/

Hi @differenceweb_ben,
There are 2 things you need to check:

  1. Make sure your multi select element has [] in the end of the name: name="myinput[]"
  2. In server connect insert step add a join formatter like: {{$_POST.myinput.join(",", null)}}
1 Like

Hi Teodor & ben,

Thanks for that however I’m still having issues with it - I’ve double checked it (see below)

<select name="location[]" multiple id="location" class="form-control" >
                    <option value="Front">Front</option><option value="Front B">Front B</option><option value="Front C">Front C</option><option value="Back">Back</option><option value="Back B">Back B</option><option value="Back C">Back C</option><option value="Verge">Verge</option><option value="Side">Side</option></select>

and

But It still isn’t updating the data to the database, in fact now its just leaving the “location” column blank.

@Teodor, Gone through everything I can think of (was having other issues so even reinstalled wappler) but still no luck. No problems updating all the other records, it just won’t update the location. I’ve triple checked everything but still no luck.

I’m only guessing here, but could it be that Server Connect has a problem with a space in the value?

May be way off target here but try changing null to Null, gut feeling it should be an initial caps?

Sorry guys, I’ve been unwell for a couple of weeks, just getting back into this - i’ve tried both checking that null is Null (with capital) and I’ve also made sure there is no space in the value and there isn’t.

Still can’t seem to work this one out.

Hello Ben,
I was looking at this thread, it also did not work for me using the current wappler version and NodeJS. Did you get it to work?
Banky