If checkbox is checked I want to store a value in php variable and for unchecked store another value
<script>
$('input[type="checkbox"][name="change"]').change(function() {
if(this.checked) {
<?php $sql="SELECT * FROM `order` ORDER BY sl_no ASC"?>
} else {
<?php $sql="SELECT * FROM `order` ORDER BY sl_no DESC"?>
}
});
</script>
<input type="checkbox" name="change">
Aucun commentaire:
Enregistrer un commentaire