I attempt to disable my specific bootstrap select option using javascript.
I know how to disable \"normal select option\", but when using bootstrap select it just di
Using render as mentioned above is no longer the working. As written in their Docs refresh is the method to use after changing options.
To programmatically update a select with JavaScript, first manipulate the select, then use the refresh method to update the UI to match the new state. This is necessary when removing or adding options, or when disabling/enabling a select via JavaScript.
function disableDropdown(){
var selectobject;
selectobject = document.getElementById("dropdownBranch").getElementsByTagName("option");
selectobject[3].disabled = true;
$('#dropdownBranch').selectpicker('refresh');
}