Allows a group of dropdowns to share a common set of options that are show/hidden if one is selected
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README.md
example-optgroups.html
example.html
jquery.shared.options.js

README.md

A jQuery plugin that allows a group of select dropdowns to share a common set of options, where if one of the options is selected it becomes unavailable in the other select dropdowns.

Example Usage

You probably want to just look at the example, but if you prefer to read prose instead of code, here goes --

`$('select.shared-options').sharedOptions();

Note: Like you'd expect, you may use any jQuery selector for the first call. The plugin is also written to support idiomatic jQuery chain-ability so you can do things like:

$('select.shared-options').sharedOptions().somethingElse().anotherThing();

Known Limitations/Shortcomings

  • Currently, only works for select dropdowns that do not allow multiple selections to be made