如何将值从ejs表单传递到nodejs

时间:2018-07-11 07:47:44

标签: html node.js express mongoose ejs

下面的代码在获取时可以正常工作..但是我不希望子标志div占用会影响提交按钮正确显示位置的空间。还有其他方法可以将值传递给app.js

app.post("/activitieslist/:id/edit", function(req. res) {
  var astname = req.body.astname;
  var subflag = req.body.subflag;
  console.log(astname, subflag);
  });
<form action="/activitieslist/<%= activitylist._id %>/edit" method="POST">
<div class="form-group">
        <label>Asset Name :
        </label>
        <input class="form-control" type="text" name="astname" value="<%= activitylist.astname %>">
</div>
<div class="form-group invisible">
      <input type="text" name="subflag" value="N">
</div>
<button class ="btn btn-info"><i class="fas fa-edit"></i>Save</button>
</form>

0 个答案:

没有答案