title: Proper way to read checkbox data in NodeJS
body: <p>I have a form on my webpage and its being submitted to a NodeJS backend.
  I'm having trouble with the checkboxes. When the are submitted to server, and I read them via <code>req.body.foods</code>, I get something like <code>['on', 'on', 'on']</code>.</p>
  
  <p>But I want to get the actual values, that is, something like <code>['dairy', 'fish']</code> etc.</p>
  
  <p>How can I do that?</p>
  
  <pre><code>&lt;div class="col-sm-6"&gt;
      &lt;div class="checkbox"&gt;
          &lt;label&gt;&lt;input name="food" type="checkbox" value="dairy"&gt;Dairy&lt;/label&gt;
      &lt;/div&gt;
      &lt;div class="checkbox"&gt;
          &lt;label&gt;&lt;input name="food" type="checkbox" value="meat"&gt;Meat&lt;/label&gt;
      &lt;/div&gt;
      &lt;div class="checkbox"&gt;
          &lt;label&gt;&lt;input name="food" type="checkbox" value="fish"&gt;Fish&lt;/label&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>