title: jQuery limit "Dropdown Check List" selects
body: <p>I'm using jquery with dropdownchecklist item.
  this is my code to config selectbox.</p>
  
  <pre><code>jQuery('#selectbox').dropdownchecklist({ width: 120, maxDropHeight: 100, firstItemChecksAll: false, emptyText: 'Select' });
  </code></pre>
  
  <p>I want to limit the select for only 2 selects.
  If the user select 2 options all others item will disable for selecting.
  How can I do it?</p>
  
  <p>Update:
  I found the easiest way to do this </p>
  
  <pre><code> function Selectbox_limit(jidList) {
      var jids = '';
      var counter = 0;
  for(var i=0; i&lt;jidList.options.length; i++) {
      if(jidList.options[i].selected == true)
          counter++;
  
      if(counter &gt;= 2) {
          jidList.options[i-1].selected = false;
                      jQuery("#selectbox").dropdownchecklist("destroy");
                      jQuery("#selectbox option").attr('disabled','disabled');
                      jQuery("#selectbox option:selected").attr("disabled","");
                      jQuery('#selectbox').dropdownchecklist({ _propeties_ });
          return; 
      } else if(counter &lt; 2) {
  
                  jQuery("#selectbox").dropdownchecklist("destroy");
                  jQuery("#selectbox option").attr("disabled","");
                  jQuery('#selectbox').dropdownchecklist({  _propeties_ });
          return; 
      }
  }
  </code></pre>