Monday 10 April 2017

Node.js - Pass input value to variable (GET METHOD)

I want to use the value of a hidden text during router.get. This are my codes.

index.handlebars

    <!DOCTYPE html>
    <html>
      <head>
        <meta charset="utf-8">

        <title></title>
      </head>
      <body>
        <input type="hidden" name="username" value="test">
      </body>
    </html>

js form

router.get('/', ensureAuthenticated, function(req, res){

  var username = [here!!!];


});

I already tried suing req.query.username but its not working. Please help :/



via Lawrence Ricafort Bacus

No comments:

Post a Comment