lundi 19 juin 2017

Materialize switch

Good day.

Trying to create a checkbox (materialize switch), which, if you change it, submits the form. The problem is, that it returns the value as $_POST['statusValue'] ONLY if its originally not checked, if it is - returns null.

Any ideas?

<div class="switch"> 
<form method="post"> 
<label style="font-size: 10px"> 
Off 
<input type="checkbox" value="<?php echo $q->questionnaire->questionnaire_id?>" name="statusValue" id="statusValue" onclick='this.form.submit()' <?php echo $q->questionnaire->questionnaire_status == 1 ? 'checked="checked"' : '';?» 
<span class="lever"></span> 
On 
</label> 
</form> 
</div>




Aucun commentaire:

Enregistrer un commentaire