This may not be a ideal solution for this issue, but I hope it will resolve your issue.
You need to write small code under "onDropdownShow" and "onDropdownHide" events of bootstrap multiselect dropdown.
Change the javascript configuration as below.
jQuery('#availablePositions').multiselect({
nonSelectedText: 'Select positions',
includeSelectAllOption: true,
includeSelectAllIfMoreThan: 5,
selectAllText: 'Select all positions',
maxHeight: 300,
buttonWidth: '100%',
onDropdownShow: function(event) {
var positions = jQuery('#availablePositions').val();
Validate(jQuery('#availablePositions'), positions);
},
onDropdownHide: function(event) {
var positions = jQuery('#availablePositions').val();
Validate(jQuery('#availablePositions'), positions);
}
});
The above code will call Validate method and pass the selected options whenever the dropdown window is shown or hidden. If the options parameter is not empty, Then search for the container with the class "has-error". If the container is with "has-error", then remove span with class 'help-block' and also remove the class 'has-error'.
var Validate = function(element, selectedOptions)
{
if (!jQuery.isEmptyObject(selectedOptions))
{
var errorContainer = jQuery(element).parents('.has-error');
jQuery('span.help-block', errorContainer).remove();
errorContainer.removeClass('has-error');
}
}