title: jQuery - filter by visibility, and if checked
body: <p>I have some code that shows/hides checkboxes using the visibility attribute. If the button is visble, when the form is submitted, I need to somehow ensure that <em>all</em> visible checkboxes are indeed checked.</p>
  
  <p>Here's my attempt so far:</p>
  
  <pre><code>$("form").submit(function() {
      if ($(':checkbox:visible:not(:checked)').filter(function() {
      return $(this).css('visibility') != 'hidden';
      }).length) {
          alert('return false');
      }
  });
  </code></pre>
  
  <p>The problem seems to be that $(this) after the filter is the form rather than the checkbox.</p>
  
  <p>Any suggestions would be very welcome, than you!</p>