It's pronounced Diane. I do data architecture, operations, and backend development. In my spare time I maintain Massive.js, a data mapper for Node.js and PostgreSQL.
req.body is a hash, not an array. You can't iterate it, but you shouldn't need to. If you want the scores for the fifth hole, for example, that's req.body.PAR5 based on how you've named your input elements. That is an array since you have multiple inputs named PAR5, so Mike's score should be req.body.PAR5[0].
Unfortunately, i don't find much time to work on this, but today i got back to it and found a problem. I don't know if it is an issue i have to deal with because of HTML or because of body.parser.
I have a golf course named 'Highland Park'
i pass the course in as result in my .pug file and it displays properly.
I then have a hidden field in my body for the course name
td: b <input type="hidden" name = "COURSE" value= #{result}
when i process my hash, course shows as 'Highland'
it doesn't appear to be a size issue, but something to do with the space.
If i change the course name to 'HighlandPark', my hash shows 'HighlandPark'
Hope that makes sense.
Any idea how to handle this?
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
req.body
is a hash, not an array. You can't iterate it, but you shouldn't need to. If you want the scores for the fifth hole, for example, that'sreq.body.PAR5
based on how you've named your input elements. That is an array since you have multiple inputs namedPAR5
, so Mike's score should bereq.body.PAR5[0]
.I was close.
The example i came across,showed req.body[0].PAR5
thanks for the help.
Unfortunately, i don't find much time to work on this, but today i got back to it and found a problem. I don't know if it is an issue i have to deal with because of HTML or because of body.parser.
I have a golf course named 'Highland Park'
i pass the course in as result in my .pug file and it displays properly.
I then have a hidden field in my body for the course name
td: b <input type="hidden" name = "COURSE" value= #{result}
when i process my hash, course shows as 'Highland'
it doesn't appear to be a size issue, but something to do with the space.
If i change the course name to 'HighlandPark', my hash shows 'HighlandPark'
Hope that makes sense.
Any idea how to handle this?