我想将ejs传递的值传回我的nodejs服务器

问题描述 投票:0回答:1

Here I am console.log() these values on app.js getting value from my page.ejs file, all the console.log() is working except req.body.name.

Here is the ss of page.ejs file. I am not able to get how to send back the value of <%= name %>我的nodejs服务器的后面。我尝试过使用按钮和跨度标签,但没有得到结果。

node.js mongodb mongoose ejs
1个回答
0
投票

您只需在按钮中添加 value 属性并更改其名称即可。

<button name="name" value="<%= name %>"><%= name %></button>
© www.soinside.com 2019 - 2024. All rights reserved.