我怎么能告诉我的NodeJS服务器哪个button被点击在一个HTTPforms与两个button?

我试图做一个NodeJS的Web应用程序,需要在文本框中的用户input,然后将它用于两个function(客户端)之一,基于哪个button被点击。 我可以吗
1)基于哪个button被点击或调用不同的动作
2)通过邮件正文区分两个button

我注意到,当按下不同的button时,我得到两个不同的响应console.log(req.body)与下面的代码。 当我点击提交button,我得到“{处理:'blahblahblah',hadunkachud:''}”当我点击新鲜的button,我得到“{处理:'blahblahblah',hingle:''}”

然而,我不能找出一种方法来访问响应的独特的部分,因为试图访问req.body的第二个数组值没有给我

下面的代码是在翡翠

extends layout block content h1= title form#formEnterHandle(name="enterhandle",method="post",action="/showid") input(type="text", placeholder="themirage", name="handle") button(name = "hadunkachud", type="submit") submit button(name = "hingle", type = "submit") fresh 

使用input,而不是button,你可以传递值:

 extends layout block content h1= title form#formEnterHandle(name="enterhandle",method="post",action="/showid") input(type="text", placeholder="themirage", name="handle") input(name="submit", value = "hadunkachud", type="submit") input(name="submit", value= "hingle", type = "submit") 

现在,发布的submit值应该等于您单击的任何button。