title: prevent duplicate choice in dropdowns with JavaScript
body: <p>I have 5 dropdowns, named sample1 through sample5... each dropdown contains the same list of choices (populated from my SQL with ASP), but I need to stop them from submitting duplicates.  All 5 need to be different.  However, 0 is acceptable as a value for each of them (blank).</p>
  
  <pre><code>FREE Sample Choice 1: &lt;select name="sample1" onChange="JavaScript:FOSamples()"&gt;
  &lt;option value="0"&gt;&lt;/option&gt;
  &lt;option value="FOABSOLUTETULIP"&gt;Fragrance Oil: Absolute Tulip BBW Type&lt;/option&gt;
  &lt;option value="FOAFRICANMUSK"&gt;Fragrance Oil: African Musk&lt;/option&gt;
  &lt;option value="FOALMOND"&gt;Fragrance Oil: Almond&lt;/option&gt;
  &lt;option value="FOAMAR"&gt;Fragrance Oil: Amaretto&lt;/option&gt;
  &lt;option value="FOAMBER"&gt;Fragrance Oil: Amber&lt;/option&gt;
  &lt;option value="FOAMBERROM"&gt;Fragrance Oil: Amber Romance Victoria's Secret Type&lt;/option&gt;
  &lt;option value="FOANAIS"&gt;Fragrance Oil: Anais Anais Type&lt;/option&gt;
  &lt;option value="FOANGEL"&gt;Fragrance Oil: Angel Type&lt;/option&gt;
  &lt;option value="FOAPPLEBLOS"&gt;Fragrance Oil: Apple Blossoms&lt;/option&gt;
  &lt;option value="FOAPPLEJACK"&gt;Fragrance Oil: Apple Jack &amp; Peel&lt;/option&gt;
  &lt;option value="FOAPPLESP"&gt;Fragrance Oil: Apple Spice&lt;/option&gt;
  &lt;option value="FOAPPLEOAK"&gt;Fragrance Oil: Apples &amp; Oak&lt;/option&gt;
  &lt;option value="FOAPRICOT"&gt;Fragrance Oil: Apricot&lt;/option&gt;
  &lt;option value="FOAPRICOTPEAR"&gt;Fragrance Oil: Apricot &amp; Pear Yankee Type&lt;/option&gt;
  &lt;option value="FOAPRCREME"&gt;Fragrance Oil: Apricot Creme&lt;/option&gt;
  &lt;option value="FOAQUAREEF"&gt;Fragrance Oil: Aqua Reef Old Spice Type&lt;/option&gt;
  &lt;option value="FOARABIANMUSK"&gt;Fragrance Oil: Arabian Musk&lt;/option&gt;
  &lt;option value="FOASIANPEAR"&gt;Fragrance Oil: Asian Pear&lt;/option&gt;
  &lt;option value="FOASIANPLUM"&gt;Fragrance Oil: Asian Plum Blossom&lt;/option&gt;
  &lt;option value="FOAUTUMNWOODS"&gt;Fragrance Oil: Autumn Woods&lt;/option&gt;
  &lt;/select&gt;&lt;br&gt;
  FREE Sample Choice 2: &lt;select name="sample2" onChange="JavaScript:FOSamples()"&gt;
  
  &lt;option value="0"&gt;&lt;/option&gt;
  &lt;option value="FOABSOLUTETULIP"&gt;Fragrance Oil: Absolute Tulip BBW Type&lt;/option&gt;
  &lt;option value="FOAFRICANMUSK"&gt;Fragrance Oil: African Musk&lt;/option&gt;
  &lt;option value="FOALMOND"&gt;Fragrance Oil: Almond&lt;/option&gt;
  &lt;option value="FOAMAR"&gt;Fragrance Oil: Amaretto&lt;/option&gt;
  &lt;option value="FOAMBER"&gt;Fragrance Oil: Amber&lt;/option&gt;
  &lt;option value="FOAMBERROM"&gt;Fragrance Oil: Amber Romance Victoria's Secret Type&lt;/option&gt;
  &lt;option value="FOANAIS"&gt;Fragrance Oil: Anais Anais Type&lt;/option&gt;
  &lt;option value="FOANGEL"&gt;Fragrance Oil: Angel Type&lt;/option&gt;
  &lt;option value="FOAPPLEBLOS"&gt;Fragrance Oil: Apple Blossoms&lt;/option&gt;
  &lt;option value="FOAPPLEJACK"&gt;Fragrance Oil: Apple Jack &amp; Peel&lt;/option&gt;
  &lt;option value="FOAPPLESP"&gt;Fragrance Oil: Apple Spice&lt;/option&gt;
  &lt;option value="FOAPPLEOAK"&gt;Fragrance Oil: Apples &amp; Oak&lt;/option&gt;
  &lt;option value="FOAPRICOT"&gt;Fragrance Oil: Apricot&lt;/option&gt;
  &lt;option value="FOAPRICOTPEAR"&gt;Fragrance Oil: Apricot &amp; Pear Yankee Type&lt;/option&gt;
  &lt;option value="FOAPRCREME"&gt;Fragrance Oil: Apricot Creme&lt;/option&gt;
  &lt;option value="FOAQUAREEF"&gt;Fragrance Oil: Aqua Reef Old Spice Type&lt;/option&gt;
  &lt;option value="FOARABIANMUSK"&gt;Fragrance Oil: Arabian Musk&lt;/option&gt;
  &lt;option value="FOASIANPEAR"&gt;Fragrance Oil: Asian Pear&lt;/option&gt;
  &lt;option value="FOASIANPLUM"&gt;Fragrance Oil: Asian Plum Blossom&lt;/option&gt;
  &lt;option value="FOAUTUMNWOODS"&gt;Fragrance Oil: Autumn Woods&lt;/option&gt;
  &lt;/select&gt;&lt;br&gt;
  
  FREE Sample Choice 3: &lt;select name="sample3" onChange="JavaScript:FOSamples()"&gt;
  &lt;option value="0"&gt;&lt;/option&gt;
  &lt;option value="FOABSOLUTETULIP"&gt;Fragrance Oil: Absolute Tulip BBW Type&lt;/option&gt;
  &lt;option value="FOAFRICANMUSK"&gt;Fragrance Oil: African Musk&lt;/option&gt;
  &lt;option value="FOALMOND"&gt;Fragrance Oil: Almond&lt;/option&gt;
  &lt;option value="FOAMAR"&gt;Fragrance Oil: Amaretto&lt;/option&gt;
  &lt;option value="FOAMBER"&gt;Fragrance Oil: Amber&lt;/option&gt;
  &lt;option value="FOAMBERROM"&gt;Fragrance Oil: Amber Romance Victoria's Secret Type&lt;/option&gt;
  &lt;option value="FOANAIS"&gt;Fragrance Oil: Anais Anais Type&lt;/option&gt;
  &lt;option value="FOANGEL"&gt;Fragrance Oil: Angel Type&lt;/option&gt;
  &lt;option value="FOAPPLEBLOS"&gt;Fragrance Oil: Apple Blossoms&lt;/option&gt;
  &lt;option value="FOAPPLEJACK"&gt;Fragrance Oil: Apple Jack &amp; Peel&lt;/option&gt;
  &lt;option value="FOAPPLESP"&gt;Fragrance Oil: Apple Spice&lt;/option&gt;
  &lt;option value="FOAPPLEOAK"&gt;Fragrance Oil: Apples &amp; Oak&lt;/option&gt;
  &lt;option value="FOAPRICOT"&gt;Fragrance Oil: Apricot&lt;/option&gt;
  &lt;option value="FOAPRICOTPEAR"&gt;Fragrance Oil: Apricot &amp; Pear Yankee Type&lt;/option&gt;
  &lt;option value="FOAPRCREME"&gt;Fragrance Oil: Apricot Creme&lt;/option&gt;
  &lt;option value="FOAQUAREEF"&gt;Fragrance Oil: Aqua Reef Old Spice Type&lt;/option&gt;
  &lt;option value="FOARABIANMUSK"&gt;Fragrance Oil: Arabian Musk&lt;/option&gt;
  &lt;option value="FOASIANPEAR"&gt;Fragrance Oil: Asian Pear&lt;/option&gt;
  &lt;option value="FOASIANPLUM"&gt;Fragrance Oil: Asian Plum Blossom&lt;/option&gt;
  &lt;option value="FOAUTUMNWOODS"&gt;Fragrance Oil: Autumn Woods&lt;/option&gt;
  &lt;/select&gt;&lt;br&gt;
  
  FREE Sample Choice 4: &lt;select name="sample4" onChange="JavaScript:FOSamples()"&gt;
  &lt;option value="0"&gt;&lt;/option&gt;
  &lt;option value="FOABSOLUTETULIP"&gt;Fragrance Oil: Absolute Tulip BBW Type&lt;/option&gt;
  &lt;option value="FOAFRICANMUSK"&gt;Fragrance Oil: African Musk&lt;/option&gt;
  &lt;option value="FOALMOND"&gt;Fragrance Oil: Almond&lt;/option&gt;
  &lt;option value="FOAMAR"&gt;Fragrance Oil: Amaretto&lt;/option&gt;
  &lt;option value="FOAMBER"&gt;Fragrance Oil: Amber&lt;/option&gt;
  &lt;option value="FOAMBERROM"&gt;Fragrance Oil: Amber Romance Victoria's Secret Type&lt;/option&gt;
  &lt;option value="FOANAIS"&gt;Fragrance Oil: Anais Anais Type&lt;/option&gt;
  &lt;option value="FOANGEL"&gt;Fragrance Oil: Angel Type&lt;/option&gt;
  &lt;option value="FOAPPLEBLOS"&gt;Fragrance Oil: Apple Blossoms&lt;/option&gt;
  &lt;option value="FOAPPLEJACK"&gt;Fragrance Oil: Apple Jack &amp; Peel&lt;/option&gt;
  &lt;option value="FOAPPLESP"&gt;Fragrance Oil: Apple Spice&lt;/option&gt;
  &lt;option value="FOAPPLEOAK"&gt;Fragrance Oil: Apples &amp; Oak&lt;/option&gt;
  &lt;option value="FOAPRICOT"&gt;Fragrance Oil: Apricot&lt;/option&gt;
  &lt;option value="FOAPRICOTPEAR"&gt;Fragrance Oil: Apricot &amp; Pear Yankee Type&lt;/option&gt;
  &lt;option value="FOAPRCREME"&gt;Fragrance Oil: Apricot Creme&lt;/option&gt;
  &lt;option value="FOAQUAREEF"&gt;Fragrance Oil: Aqua Reef Old Spice Type&lt;/option&gt;
  &lt;option value="FOARABIANMUSK"&gt;Fragrance Oil: Arabian Musk&lt;/option&gt;
  &lt;option value="FOASIANPEAR"&gt;Fragrance Oil: Asian Pear&lt;/option&gt;
  &lt;option value="FOASIANPLUM"&gt;Fragrance Oil: Asian Plum Blossom&lt;/option&gt;
  &lt;option value="FOAUTUMNWOODS"&gt;Fragrance Oil: Autumn Woods&lt;/option&gt;
  &lt;/select&gt;&lt;br&gt;
  
  FREE Sample Choice 5: &lt;select name="sample5" onChange="JavaScript:FOSamples()"&gt;
  &lt;option value="0"&gt;&lt;/option&gt;
  &lt;option value="FOABSOLUTETULIP"&gt;Fragrance Oil: Absolute Tulip BBW Type&lt;/option&gt;
  &lt;option value="FOAFRICANMUSK"&gt;Fragrance Oil: African Musk&lt;/option&gt;
  &lt;option value="FOALMOND"&gt;Fragrance Oil: Almond&lt;/option&gt;
  &lt;option value="FOAMAR"&gt;Fragrance Oil: Amaretto&lt;/option&gt;
  &lt;option value="FOAMBER"&gt;Fragrance Oil: Amber&lt;/option&gt;
  &lt;option value="FOAMBERROM"&gt;Fragrance Oil: Amber Romance Victoria's Secret Type&lt;/option&gt;
  &lt;option value="FOANAIS"&gt;Fragrance Oil: Anais Anais Type&lt;/option&gt;
  &lt;option value="FOANGEL"&gt;Fragrance Oil: Angel Type&lt;/option&gt;
  &lt;option value="FOAPPLEBLOS"&gt;Fragrance Oil: Apple Blossoms&lt;/option&gt;
  &lt;option value="FOAPPLEJACK"&gt;Fragrance Oil: Apple Jack &amp; Peel&lt;/option&gt;
  &lt;option value="FOAPPLESP"&gt;Fragrance Oil: Apple Spice&lt;/option&gt;
  &lt;option value="FOAPPLEOAK"&gt;Fragrance Oil: Apples &amp; Oak&lt;/option&gt;
  &lt;option value="FOAPRICOT"&gt;Fragrance Oil: Apricot&lt;/option&gt;
  &lt;option value="FOAPRICOTPEAR"&gt;Fragrance Oil: Apricot &amp; Pear Yankee Type&lt;/option&gt;
  &lt;option value="FOAPRCREME"&gt;Fragrance Oil: Apricot Creme&lt;/option&gt;
  &lt;option value="FOAQUAREEF"&gt;Fragrance Oil: Aqua Reef Old Spice Type&lt;/option&gt;
  &lt;option value="FOARABIANMUSK"&gt;Fragrance Oil: Arabian Musk&lt;/option&gt;
  &lt;option value="FOASIANPEAR"&gt;Fragrance Oil: Asian Pear&lt;/option&gt;
  &lt;option value="FOASIANPLUM"&gt;Fragrance Oil: Asian Plum Blossom&lt;/option&gt;
  &lt;option value="FOAUTUMNWOODS"&gt;Fragrance Oil: Autumn Woods&lt;/option&gt;
  &lt;/select&gt;&lt;br&gt;
  </code></pre>
  
  <p><a href="http://jsfiddle.net/Kateriana/nDGu8/" rel="nofollow">5 Dropdowns Fiddle Sample</a></p>
  
  <p>The dropdowns are identical so maybe removing the option from the other 4 when selected would be better?  I really am not sure of the capabilities of JavaScript (my expertise is ASP and SQL).  Should I do ONE dropdown and limit it to 5 Ctrl+click selections?  I went ahead and started a fiddle with this layout too.</p>
  
  <p><a href="http://jsfiddle.net/Kateriana/N4uHd/1/" rel="nofollow">Single Multiple Dropdown</a></p>
  
  <p>I'm not sure which option my boss would prefer.  We use the 5 dropdowns now, but maybe the other one would be cleaner.  Do you have problems with people not understanding how to select mutliple items?</p>
  
  <p>Can one of you JavaScript gurus write my FOSamples function to work?  Is OnChange the correct javascript to use?  Right now, the office has to just watch for duplicates and manually remove and replace with something else.</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  &lt;!--
      function FOSamples() {
  
      }
  --&gt;
  &lt;/script&gt;
  </code></pre>
  
  <p>Mahalo!</p>