select-sync
select-sync
is a plugin to synchronize selects by selected or disabled options. Works great for many selects which are for an array or multiple selects for one value.
Requires a DOM library such as jQuery, Zepto, or any other $ library.
Install
Yarn, NPM, or Bower
yarn add select-sync
npm install select-sync
bower install select-sync
Rails Install
# Gemfile source 'https://rails-assets.org' do end # app/assets/javascripts/application.js /* *= *= */
Usage
; ; // Remove select sync;; ;
Limitations
- Currently can only have one sync per type per select.
- Doesnt work for multi-selects. They try to solve the same issue as this plugin. I would try using a chosen multi-select before resorting to using this plugin.
Credits
Created by Weston Ganger - @westonganger