say have button like
<form action="/action1" method ="post"> <button type="submit" id="button1"> click me </button> </form> i want value stored in attributes (in case "id") , this
app.post('/action1', function (req, res) { var buttonid = req.id // part dont understand }); how fill in line
var buttonid = thank you
the posted data not include id attribute. can set name and/or value attribute , part of post request. e.g.
<button type="submit" name="button1">click me</button> to posted data in express here: express js form data
Comments
Post a Comment