I have recently started using Eric Hynds' amazing dropdown plugin and I am looking to implement the enable/disable function on multiple dropdowns. The form I am working on is quite complex, with various dropdowns that need to be toggled on and off using jQuery sliders.
If you want to check out the plugin in action, here is the link:
The code snippet provided includes a variable that I am struggling to understand as it currently only deals with one dropdown. Can anyone offer guidance on how to modify this code to work with multiple dropdowns? I am aiming to have separate buttons for triggering different dropdowns, but the current code structure does not seem to support this functionality.
var $widget = $("select").multiselect(),
state = true;
$("#toggle-disabled").click(function(){
state = !state;
$widget.multiselect(state ? 'disable' : 'enable');
});
In addition to the dropdown plugin, I am also utilizing another plugin that transforms list/input items into sliders. If things look a bit odd, it's because I am leveraging this method to capture mouse events effectively.
<li class="toggle-disabled"><label for="family">Family Medicine </label><input type="checkbox" id="family" name="family" />