I am using Bootstrap Switch plugin and Bootstrap Modal. Once the user clicks to change the Switch from on to off the Modal box fades in asking for a confirmation.
How do I change the Switch from on to off or from off to on only after the user clicks on Confirm button? If the user clicks on Cancel then the Switch should go back to Off status.
$("#myswitch").bootstrapSwitch();
$('#myswitch').on('switchChange.bootstrapSwitch', function (e, data) {
$('#showModal').modal({
backdrop: 'static',
keyboard: false
});
});