Created
March 2, 2016 05:46
-
-
Save des1roer/b7618371587d3dff1701 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$smena_plan = ($_POST['smena_plan'] == 'true') ? 'checked' : NULL ; | |
$smena_fact = ($_POST['smena_fact'] == 'true') ? 'checked' : NULL ; | |
?> | |
<label ><input type="checkbox" id="c_smena_plan" <?= $smena_plan ?>/> Смена(план)</label> | |
<label ><input type="checkbox" id="c_smena_fact" <?= $smena_fact ?>/> Смена(факт)</label> | |
<form name="upsert" id ="myForm" method="POST"> | |
<input id="smena_plan" name="smena_plan" type="hidden" value="<?= $smena_plan ?>"> | |
<input id="smena_fact" name="smena_fact" type="hidden" value="<?= $smena_fact?>"> | |
</form> | |
<script> | |
$(document).ready(function () { | |
$("input:checkbox").change(function () { | |
$('#smena_plan').val($("#c_smena_plan").prop("checked")); | |
$('#smena_fact').val($("#c_smena_fact").prop("checked")); | |
$('#myForm').submit(); | |
}); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment