I have a bootstrap switch, but I don't want it to toggle everytime. I want to check that a condition is true, and only then toggle the switch. How can I do that? This is what I have so far:
$("[name='relVal']").bootstrapSwitch({
onSwitchChange: function(event, state) {
if (condition_is_met) {
$("[name='relVal']").bootstrapSwitch('state', true);
}
}
})