On my HTML page I have a few select menus which all share the class name
and when the page is generated with PHP some of the select menus will have been hidden by PHP adding another class to the select menu.
Anyway I then wanted to disable only the hidden
which I have been trying to use the following:
This runs without no errors but the disabled attribute does not show up on my select menu, thus not disabling input. So I did some research and found that I could use
inside my .each() above after the first line. However I get an error TypeError: $(...).multiselect is not a function
I also tried using
but get the following: Error: cannot call methods on selectmenu prior to initialization; attempted to call method 'refresh' and this also produces the same result, being the disabled attribute to the select menu is added whereas without this it did not before.
I tried to initialize the select menu but it just adds a span to the HTML and messes up select menu by showing the first selection as text outside the select menu?
I also tried to use PHP to output the "disabled" attribute to the select menu HTML but when loaded in the browser it does not show and is removed :/
Any help thanks in advanced!