Prevent duplicate choice in multiple dropdowns
<p>I'm using the following script which displays a pop-up error if a person has picked same values from multiple drop-downs. Works great, however after showing the pop-up, the duplicate selection still takes place. It should prevent this from happening. </p>

<pre><code>$(document).ready(function () {
    $('select').change(function () {
        if ($('select option[value="' + $(this).val() + '"]:selected').length &gt; 1) {
            alert('You have already selected this option previously - please choose another.')
        }
    });
});
</code></pre>

<p><a href="https://jsfiddle.net/k10vcny2/" rel="nofollow">jsfiddle example here</a></p>