将文本框值从Jade传递给node.js

时间:2015-12-02 13:16:14

标签: node.js express pug

如何将文本框值从Jade发送到node.js

form(action='/send', method='POST')
              pre

                   label From   :

                   input(type='text',id="Fromtime", name='f1_time')
                   br
                   label To     :
                   input(type='text', id="Totime", name='t1_tdime')
                   br
                   br
                   br
                   label On :
                   input(type='radio', name='on', id='amount_0')
                   label Off:
                   input(type='radio', name='off', id='amount_1')
                   br
                   br
                   br
                   input(type='submit', value='Send !')

如何使用module express

来使用app.js中文本的值

由于

1 个答案:

答案 0 :(得分:0)

app.js

app.post('/send', function(req, res) {
    console.log(req.body.f1_time); // show the value of the text box
});

Docs

相关问题