

If you have a link to file where I can just read the code and learn how to display checkbox selections in pug, I would be appreciate it as well.

I searched stackoverflow, github for checkbox pug/express.js examples but couldn't find any. If any javascript ninja out there to show me, I would appreciate it.

How do I fix this? What is the right way to display checkbox selections from the array correctly (my selection has the value of one, two, three so how to display the selected checkbox in pug as one, two, three) and I understand it might be a simple issue but I'm new and unable to think how to do it. The array is displayed as one character per line like this o When I post the array in the collect.jade like this extends layout Here is my express.js route enter code hereouter.get('/checkbox', function (req, res, next) ) Input#defaultCheck1.form-check-input(type='checkbox',name="cb", value='two') Input#defaultCheck1.form-check-input(type='checkbox',name="cb", value='one') Label.form-check-label(for='defaultCheck1') Input#defaultCheck1.form-check-input(type='checkbox',name="cb", Here is the form jade file enter code hereextends layout My issue is how to display this array in PUG. I can see my correct selection in my console log as array. One can also add an else block that will be executed if the array or object does not contain. Have fun All the demos in this article are available in this CodePen collection. You can also leverage some of Pug s awesome features to speed things up, mitigate errors, and randomly generate demos. So, it can be a variable, or the result of a function call, or almost anything else. In 5 minutes you now know enough Pug to be well on your way to speeding up your markup generation. I enter my selections and able to post the form to a page. Pug’s first-class iteration syntax makes it easier to iterate over arrays and objects in a template: The object or array to iterate over is just plain JavaScript. I have a simple form with three checkbox selections using bootstrap.
