'how to receive a multi select in expressjs
Hello I have a multi select that looks like this
input.form-control(type='text', name='names[]')
I want to retrieve does values. I'm using this
var names = req.body.names[];
Obviously that not working. How do i get the values of an array using expressjs.
Thanks
Solution 1:[1]
From the comments, credit Ben Fortune:
You'll need req.body['names[]']
, though BodyParser
should parse this and req.body.names
should be an array.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Tyler2P |