title: Chosen plugin max_selected_options
body: <p>I use <a href="http://harvesthq.github.com/chosen/" rel="noreferrer">Chosen</a> jquery plugin and I noticed that <strong>max_selected_options</strong> is not working: </p>
  
  <p>The code is this:</p>
  
  <pre><code>&lt;!doctype html&gt; 
  &lt;html lang="en"&gt; 
  &lt;head&gt;
      &lt;link rel="stylesheet" href="chosen/chosen.css" /&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;select id="assets" data-placeholder="Choose assets" class="chzn-select" multiple style="width:350px;" tabindex="4"&gt;
      &lt;option value="a"&gt;a&lt;/option&gt;
      &lt;option value="b"&gt;b&lt;/option&gt;
      &lt;option value="c"&gt;c&lt;/option&gt;
      &lt;option value="d"&gt;d&lt;/option&gt;
      &lt;option value="e"&gt;e&lt;/option&gt;
      &lt;option value="f"&gt;f&lt;/option&gt;
      &lt;option value="g"&gt;g&lt;/option&gt;
  &lt;/select&gt;
  
  &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="chosen/chosen.jquery.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt; 
  
  
      $(document).ready(function(){
          $(".chzn-select").chosen();
          $(".chzn-select-deselect").chosen({allow_single_deselect:true});
          $('.chzn-select').chosen({ max_selected_options: 3 });
          $(".chzn-select").bind("liszt:maxselected", function () { alert("a"); });
          $(".chzn-select").chosen().change( function () { alert("a"); } );
      });
  
  &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I don't understand what is incorrect to my code. This line:</p>
  
  <pre><code>$('.chzn-select').chosen({ max_selected_options: 3 });
  </code></pre>
  
  <p>should limit the maximum number of allowed selections. But it doesn't work. I still can select any number of items.
  I noticed that also the event that should be fired on the case the maximum number of selected items is reached doesn't fire:</p>
  
  <pre><code>$(".chzn-select").bind("liszt:maxselected", function () { alert("a"); });
  </code></pre>
  
  <p><strong>Do I have any error in code?</strong></p>
  
  <p>And one more question: how can I add search functionality to my list, like the search box that appears on the first example on the plugins page?</p>
  
  <p>Thanks. </p>