title: Checkbox in Express
body: <p>I'm currently trying to parse over checkbox values into an array via express/ejs.</p>
  
  <p>Currently, a user is supposed to fill in a form like this and thick a check box:
  Answer:  Checkbox: </p>
  
  <p>I want to parse the data such that I got two arrays from the inputs:</p>
  
  <p>answer = ["string 1", "string 2", "string 3", "string 4"]
  checkbox = [checked, unchecked, unchecked, unchecked]</p>
  
  <p>Problem is, express only parses through checked checkboxes and not the unchecked values (so all i get is checkbox = "checked"). </p>
  
  <p>How do I get express to log the "unchecked" values as well? I've considered setting value = true/false depending on whether the checkbox is checked, but I can't figure out how to check that in ejs.</p>
  
  <p>Thank you!</p>
  
  <p>JS</p>
  
  <pre><code>router.post(`/`, (req, res) =&gt; {
      console.log(req.body);
      res.redirect(`/`);
  })
  </code></pre>
  
  <p>EJS</p>
  
  <pre><code>&lt;form action="/question" method="post"&gt;
          &lt;label for="sessionName"&gt;Session Name&lt;/label&gt;&lt;input type="text" name="sessionName"&gt;
          &lt;div class="question"&gt;
              &lt;label for="question"&gt;Question: &lt;/label&gt;&lt;input type="textarea" name="question"&gt;
              &lt;ul&gt;
                  &lt;li&gt;&lt;label for="answer"&gt;Answer 1: &lt;/label&gt;&lt;input type="textarea" name="answer"&gt;&lt;input type="checkbox" name="test" value="1"&gt;&lt;/li&gt;
                  &lt;li&gt;&lt;label for="answer"&gt;Answer 2: &lt;/label&gt;&lt;input type="textarea" name="answer"&gt;&lt;input type="checkbox" name="test" value="1"&gt;&lt;/li&gt;
                  &lt;li&gt;&lt;label for="answer"&gt;Answer 3: &lt;/label&gt;&lt;input type="textarea" name="answer"&gt;&lt;input type="checkbox" name="test" value="1"&gt;&lt;/li&gt;
                  &lt;li&gt;&lt;label for="answer"&gt;Answer 4: &lt;/label&gt;&lt;input type="textarea" name="answer"&gt;&lt;input type="checkbox" name="test" value="1"&gt;&lt;/li&gt;
              &lt;/ul&gt;
          &lt;/div&gt;
          &lt;input type="submit" name="" value="Create Session"&gt;
      &lt;/form&gt;
  </code></pre>