Create a form with Jade
Code is put inside a .jade file. These examples were placed inside the index.jade file of an express application.
extends ../layout
block content
h1= title
form(name="add-estimation", method="post")
div.input
span.label Title
input(type="text", name="title")
div.actions
input(type="submit", value="add")
Add a textarea to the form
extends ../layout
block content
h1= title
form(name="add-estimation", method="post")
div.input
span.label Title
input(type="text", name="title")
div.input
span.label Description
textarea(name="description", cols="40", rows="5")
div.actions
input(type="submit", value="add")
The input can be fetched in a router.post method. In this example in the index.js files in the routes directory of the express application.
router.post('/', function (req, res) {
console.log(req.body.title);
console.log(req.body.description);
res.send('Post page');
});