title: Checked and Unchecked value of checkbox get submitted to controller
body: <p>I have this form with 14 checkboxes, some may be checked and the user is free to uncheck them as needed.</p>
  
  <pre><code>&lt;?php $form = ActiveForm::begin(); ?&gt;
  
  &lt;h3&gt;New Courses&lt;/h3&gt;
  &lt;?= GridView::widget([
  'dataProvider' =&gt; $ns_dataProvider,
  'summary' =&gt; "{totalCount} courses",
  'columns' =&gt; [
      [
          'label'=&gt;'Register',
          'format' =&gt; 'raw',
          'value'=&gt;function ($data) use($student, $active_session_semester) {
             // return Html::a(Html::encode("Register"),'site/index');
              $studentsubject = \app\models\Studentsubject::find()-&gt;where([
                  'student_id' =&gt; $student-&gt;id,
                  'subject_id' =&gt; $data-&gt;id,
                  'level_id' =&gt; $student-&gt;current_level_id,
                  'session_semester_id' =&gt; $active_session_semester-&gt;id,
              ])-&gt;all();
              $countstudentsubject = count($studentsubject);
  
  
              if ($countstudentsubject &gt; 0) {
              return Html::checkbox('subject_id[]',true,['uncheck'=&gt;"r".$data-&gt;id,'value'=&gt;$data-&gt;id]);}
              else {
                  return Html::checkbox('subject_id[]', false, ['uncheck'=&gt;"r".$data-&gt;id,'value' =&gt; $data-&gt;id]);
              }
          },
      ],
  
      'subject_title',
  
     ],
      ]); ?&gt;
      &lt;div class="form-group"&gt;
          &lt;?= Html::submitButton($model-&gt;isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), ['class' =&gt; $model-&gt;isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?&gt;
      &lt;/div&gt;
  
      &lt;?php ActiveForm::end(); ?&gt;
  
  &lt;/div&gt;
  </code></pre>
  
  <p>I retrieved the value of the checkbox like this </p>
  
  <pre><code> if (Yii::$app-&gt;request-&gt;post()) {
          $x = Yii::$app-&gt;request-&gt;Post();
          $subject_ids = $x['subject_id'];
          var_dump($subject_ids);
    }
  </code></pre>
  
  <p>However i get this as the array with 16 values returned instead of 14: </p>
  
  <pre><code>   array (size=16)
      0 =&gt; string 'r273' (length=4)
      1 =&gt; string '273' (length=3)
      2 =&gt; string 'r274' (length=4)
      3 =&gt; string '274' (length=3)
      4 =&gt; string 'r275' (length=4)
      5 =&gt; string 'r295' (length=4)
      6 =&gt; string 'r296' (length=4)
      7 =&gt; string 'r297' (length=4)
      8 =&gt; string 'r423' (length=4)
      9 =&gt; string 'r424' (length=4)
      10 =&gt; string 'r425' (length=4)
      11 =&gt; string 'r590' (length=4)
      12 =&gt; string 'r591' (length=4)
      13 =&gt; string 'r592' (length=4)
      14 =&gt; string 'r593' (length=4)
     15 =&gt; string 'r594' (length=4)
  </code></pre>
  
  <p>When i check a checkbox, both the checked and unchecked values are sent. Am i missing something? Am fairly new to yii2. Any advice, suggestions and solutions would be highly appreciated.</p>