Your jade form (if you use express) should look like this:
form(action="/" method="post") input( name="whateverSearch" placeholder="search" autofocus)
Then, to pass the newly submitted datapoint whateverSearch , you use req.body to find it (see below). Here I took a data point and registered it on the console, and then sent it to the DOM, as well as the page title.
router.post('/', function(req, res) { whateverSearch = req.body.whateverSearch; console.log(whateverSearch); res.render('index', { title: 'MyApp', inputData: whateverSearch}); });
source share