I am new at coding with bootstrap and jquery. how can i disable bootstrap switch in "onswitchchange" method option
Here my javascript/jquery code:
$("input[type=checkbox]").bootstrapSwitch({
size:"mini",
onSwitchChange:function(event, state) {
this.disabled = true; //checkbox change into disabled
}
});
Run Code Online (Sandbox Code Playgroud)
i also tried to change this.disabled = true into $(this).setDisabled(true); and it returning error of course. i just want to know how to call setDisable method inside onswitchchange method. if it cannot be like that. is there any other way to disable the …