I use this codes for checkbox checked event but it does not work.
css
For me this was the only working code (Bootstrap 3.0) :
$('#my_checkbox').on('change.bootstrapSwitch', function(e) {
console.log(e.target.checked);
});
It returns me true or false
Example with Ajax submission on bootstrap switch change :
$('#my_checkbox').on('change.bootstrapSwitch', function(e) {
$.ajax({
method: 'POST',
url: '/uri/of/your/page',
data: {
'my_checkbox_value': e.target.checked
},
dataType: 'json',
success: function(data){
console.log(data);
}
});
});