title: Materialize switch
body: <p>Good day. </p>
  
  <p>Trying to create a checkbox (materialize switch), which, if you change it, submits the form. The problem is, that it returns the value as <code>$_POST['statusValue']</code> ONLY if its originally not checked, if it is - returns null. </p>
  
  <p>Any ideas? </p>
  
  <pre><code>&lt;div class="switch"&gt; 
  &lt;form method="post"&gt; 
  &lt;label style="font-size: 10px"&gt; 
  Off 
  &lt;input type="checkbox" value="&lt;?php echo $q-&gt;questionnaire-&gt;questionnaire_id?&gt;" name="statusValue" id="statusValue" onclick='this.form.submit()' &lt;?php echo $q-&gt;questionnaire-&gt;questionnaire_status == 1 ? 'checked="checked"' : '';?» 
  &lt;span class="lever"&gt;&lt;/span&gt; 
  On 
  &lt;/label&gt; 
  &lt;/form&gt; 
  &lt;/div&gt;
  </code></pre>