Help: Post query not working with express.js

44 views
Skip to first unread message

Ashutosh Das

unread,
Aug 3, 2013, 10:31:22 AM8/3/13
to nod...@googlegroups.com
I m coding simple cms using tinymce , Here is the code of Jade part :

body
   form(method="post" ,action='edit')
    textarea Type Something.............
    br
    input(type='submit', name="name" , value='name')

and the express part :
app.get('/edit', function(req, res){
});

app.post('/edit' , function(req, res){
    console.log(JSON.stringify(req.body));
    console.log('req.body.name', req.body['name']);
});


Everytime i hit send button it simply returns :
{"name":"names"}
req.body.name names



Martin Cooper

unread,
Aug 3, 2013, 10:44:41 AM8/3/13
to nod...@googlegroups.com
You need to give the textarea a name. Try:

    textarea(name='thing') Type Something.............

--
Martin Cooper


--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com
To unsubscribe from this group, send email to
nodejs+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
 
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Ashutosh Das

unread,
Aug 3, 2013, 11:05:01 AM8/3/13
to nod...@googlegroups.com
Thnx now its working  :)
Reply all
Reply to author
Forward
0 new messages