Get checkbox value from controlgroup
I have some throuble getting checkboxes value from controlgroup. This code always return "on",
whether or not the checkbox is set.
- <div class="grp">
<label>
<input type="checkbox" class="checkbox" /> Check me!
</label>
</div>
<script>
$(document).ready(function() {
$('.grp')
.controlgroup()
.on('change', function() {
alert($('.checkbox').val());
});
});
</script>
See the demo:
https://jsfiddle.net/crazzzy/mxfwxze8/2/