Reputation: 224
detail:how to print a specific value only on the console of the array which is send on server by post method
router.post('/', function(req, res, next) {
var mj = new Array();
mj = req.body.equip;
console.log("this" + req.body.equip[]);
console.log(mj);
});
i used this but it is not giving result
<input type="text" name="equip[]">
<input type="text" name="equip[]">
<input type="text" name="equip[]">
Upvotes: 0
Views: 309
Reputation: 1173
I think below code will help you to print each values.
var array=req.body.equip;
array.forEach(function(element) {
console.log(element);
}, this);
Upvotes: 2