title: how can I submit the value of an unchecked checkbox
body: <p>I have a user edit page with a set of user permissions. Each permission is basically a checkbox. If checked the user has the permission if unchecked the user does not have the permission. So if I want to remove a permission I would uncheck the box and vice versa to add a permission.</p>
  
  <p>I got everything to work using a hidden input, but the problem that I am having is that it is submitting both the hidden input and the checkbox value. For example even if I don't make a change and click the update button, I get a message that reads:</p>
  
  <pre><code>Removed access from 1 permission levels
  Added access to 1 permission levels
  </code></pre>
  
  <p>I will show you my code below. Something to keep in mind is that each input calls a different function.</p>
  
  <p>Here is the inputs:</p>
  
  <pre><code>&lt;ul class="list-group permission-summary-rows"&gt;
  &lt;?php //List of permission levels user is apart of
  foreach ($permissionData as $v1) {
      if(isset($userPermission[$v1['id']])){
  ?&gt;                              
      &lt;li class="list-group-item"&gt;
          &lt;?php echo $v1['name']; ?&gt;
          &lt;span class="pull-right"&gt;
              &lt;input type="hidden" name="removePermission[&lt;?php echo $v1['id'] ?&gt;]" id="removePermission[&lt;?php echo $v1['id'] ?&gt;]" value="&lt;?php echo $v1['id'] ?&gt;" &gt;
              &lt;input type="checkbox" checked data-toggle="switch" name="addPermission[&lt;?php echo $v1['id'] ?&gt;]" id="addPermission[&lt;?php echo $v1['id'] ?&gt;]" value="&lt;?php echo $v1['id'] ?&gt;" &gt;
          &lt;/span&gt;
      &lt;/li&gt;                               
  &lt;?php
      }
  }
  ?&gt;
  &lt;?php //List of permission levels user is not apart of  
  foreach ($permissionData as $v1) {
      if(!isset($userPermission[$v1['id']])){
  ?&gt;                          
      &lt;li class="list-group-item"&gt;
          &lt;?php echo $v1['name']; ?&gt;
          &lt;span class="pull-right"&gt;                                               
              &lt;input type="checkbox" data-toggle="switch" name="addPermission[&lt;?php echo $v1['id'] ?&gt;]" id="addPermission[&lt;?php echo $v1['id'] ?&gt;]" value="&lt;?php echo $v1['id'] ?&gt;" &gt;                                         
          &lt;/span&gt;
      &lt;/li&gt;                           
  &lt;?php
      }
  }
  ?&gt;
  </code></pre>
  
  <p>   </p>
  
  <p>Here is the PHP:</p>
  
  <pre><code>//Remove permission level
      if(!empty($_POST['removePermission'])) {
          $remove = $_POST['removePermission'];
          if ($deletion_count = removePermission($remove, $userId)) {
              $successes[] = lang("ACCOUNT_PERMISSION_REMOVED", array ($deletion_count));
          } else {
              $errors[] = lang("SQL_ERROR");
          }
      }
      // Add permission level
      if(!empty($_POST['addPermission'])) {
          $add = $_POST['addPermission'];
          if ($addition_count = addPermission($add, $userId)) {
              $successes[] = lang("ACCOUNT_PERMISSION_ADDED", array ($addition_count));
          } else {
              $errors[] = lang("SQL_ERROR");
          }
      }
  </code></pre>
  
  <p>Even if I add the hidden input underneath the checkbox input I receive the same message. I know it has something to do with using different functions so can anyone guide me in the right direction? Should I use some JS code to find if it is checked or not?                                 </p>