title: jQuery get list of checked checkboxes with specific class to array
body: <p>I'm trying to get the list of checked checkboxes with specific class attribute and put their values to array. I want to use it to enable / disable select menu. So far I have the following, which doesn't seem to work for me:</p>
  
  <pre><code>&lt;select name="inboxSelect" id="inboxSelect" class="selectDisabledSwitch" data-trigger="selectTrigger" disabled="disabled"&gt;
      &lt;option value=""&gt;With selected&lt;/option&gt;
      &lt;option value="1"&gt;Archive&lt;/option&gt;
      &lt;option value="2"&gt;Mark as completed&lt;/option&gt;
  &lt;/select&gt;
  
  
  &lt;input type="checkbox" name="inbox-1" id="inbox-1" value="1" class="selectTrigger" /&gt;
  &lt;input type="checkbox" name="inbox-2" id="inbox-2" value="2" class="selectTrigger" /&gt;
  &lt;input type="checkbox" name="inbox-3" id="inbox-3" value="3" class="selectTrigger" /&gt;
  </code></pre>
  
  <p>and javascript / jquery:</p>
  
  <pre><code>var frontObject = {
      getCheckboxCheckedArray : function(objClass) {
          var thisArray = $('input:checkbox:checked.' + objClass).map(function () {
              return this.value;
          }).get();
          return thisArray;
      },
      selectDisabledSwitch : function(obj) {
          if (obj.length &gt; 0) {
              var thisObj = $(this);
              var thisTrigger = thisObj.attr('data-trigger'); 
              var thisValues = frontObject.getCheckboxCheckedArray(thisTrigger);
              frontObject.disableMenu(thisObj, thisValues);
              $('.' + thisTrigger).live('change', function() {
                  var thisValues = frontObject.getCheckboxCheckedArray(thisTrigger);
                  frontObject.disableMenu(thisObj, thisValues);
              });
          }
      },
      disableMenu : function(thisObj, thisValues) {
          if (thisValues.length &gt; 0) {
              thisObj.attr('disabled', false);
          } else {
              thisObj.attr('disabled', 'disabled');
          }
      }
  };
  $(function() {
      frontObject.selectDisabledSwitch($('.selectDisabledSwitch'));
  });
  </code></pre>
  
  <p>Sorry - just to clarify - I want the select to be disabled if none of the checkboxes with the specific class is checked and remove disabled attribute when at least one is checked.</p>