javascript - POST request variables not coming through in Sails.js -


i'm new sails, may doing wrong, can't seem data form in controller.

the submit action routes proper controller method.

<form action="/create" method="post">   <div class="form-group">     <label for="title">title</label>     <input type="text" class="form-control" id="title">   </div>   <button type="submit" class="btn btn-default">submit</button> </form> 

controller action:

save: function (req, res) {     console.log(req.param('title'));     console.log(req.params.all()); } 

results in:

undefined {} 

how supposed submitted form data?

it seems omit name attribute.

    <label for="title">title</label>     <input type="text" class="form-control" id="title" name="title"> 

without parameter can't received server.


Comments

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -