Monday 24 June 2019

How to get local variables to be recognized by express-handlebars?

Forgive me I don't really know if I'm asking the question the right way.​I'm using express-handlebars. I have some views that have forms. On those forms I would like to conditionally add extra text columns if certain form options are selected. I understand that I can pass an object in my res.render() function.ie.router.get('/admin/add-race', (req, res, next) => {res.render('admin/add-race', {layout: 'admin',path: '/admin/add-race',pageTitle: 'Add Race Info'});};I could pass in something like isCertainFormOption: false how would I change that to true in the view itself if a form option is selected?

Submitted June 25, 2019 at 06:40AM by BlastHole

No comments:

Post a Comment