【发布时间】:2015-10-07 21:44:18
【问题描述】:
我有以下表单让用户上传文件并提交文本:
form(action='/createpost' enctype="multipart/form-data" method='post' id="imgForm")
input(type='file' name='imgPath' size = "60")
br
textarea(name="postText" form="imgForm") Enter your post text here...
br
input(type='submit' value="Submit")
当我运行这个时:
router.post('/createpost', function(req,res){
console.log("POST FORM BODY", req.body.postText);
res.end();
});
我在控制台中得到undefined。如何获取 textarea 中输入的值?
【问题讨论】:
标签: javascript html http express pug