Last active
August 18, 2016 11:59
-
-
Save trevarj/b1f65d010306baf1f1ffd794e8b4948e to your computer and use it in GitHub Desktop.
Synchronizes Select Dropdowns - jQuery
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function(){ | |
$('.testSubjectSelect').change(function() { | |
var selectedValues = $("option:selected").map(function(){return this.value;}); | |
$('.testSubjectSelect').children('option').not(":contains('-Select a Subject-')").each(function() { | |
if ($.inArray($(this).val(), selectedValues) > -1 && !this.selected) { | |
$(this).attr('hidden', true); | |
} else { | |
$(this).removeAttr('hidden'); | |
} | |
}); | |
}) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment