numbers in express and nodejs (body-parser)

0

I have the following problem. When the POST is made to the bakcend (Nodejs) and the last information is logged in the console the value of the inputs of type="number" is shown as if they were strings.

This is what it says:

{ student: 'a',
  term_1: '2',
  term_2: '1',
  term_3: '3' }

What I need is that the values of term_1, term_2 and term_3 are shown in numerical values, not in text.

<input type="number" min="1" max="10" name="term_1">
<input type="number" min="1" max="10" name="term_2">
<input type="number" min="1" max="10" name="term_3">
    
asked by Teo villa 11.10.2018 в 20:25
source

0 answers