Home > Back-end >  I want to pass the passed value of ejs back to my nodejs server
I want to pass the passed value of ejs back to my nodejs server

Time:10-04

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 %> back of my nodejs server. I have tried using the button and span tag but did not get the result.

CodePudding user response:

Please insert your code. Its easier to help when you insert code instead of image links. Read how to ask a question here

You just need to add value attribute in your button and change its name.

<button name="name" value="<%= name %>"><%= name %></button>
  • Related