Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6241629
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T11:48:09+00:00 2026-05-24T11:48:09+00:00

I am attemting to filter list items depending on whether certain checkboxes are checked

  • 0

I am attemting to filter list items depending on whether certain checkboxes are checked or not.

I have managed to get the filtering to work but I am struggling to remove all list items on page load.

The idea is for ‘list items’ not to display untill the ‘options’ checkboxes are ckecked

I have placed my working version online here http://dev.perfectdaycanada.com/filter/

Thank you in advanced to anyone who can help me, it’s much appreciated.


The javascript for filtering:

$(document).ready(function(){
    $("input.type_check").attr("checked", "").click(function() {
        if($(this).is(':checked')) {
            $("#case-studies li."+$(this).attr('id')).removeClass('type_hidden');
            $("#case-studies li").not(".type_hidden, .start_hidden").slideDown();
        } else {
            $("#case-studies li."+$(this).attr('id')).addClass('type_hidden');
            $("#case-studies li."+$(this).attr('id')).slideUp();
        }
    });

    $("input.start_check").attr("checked", "").click(function() {
        if($(this).is(':checked')) {
            $("#case-studies li."+$(this).attr('id')).removeClass('start_hidden');
            $("#case-studies li").not(".type_hidden, .start_hidden").slideDown();
        } else {
            $("#case-studies li."+$(this).attr('id')).addClass('start_hidden');
            $("#case-studies li."+$(this).attr('id')).slideUp();
        }
    });
});

HTML:

<div>
    <input name="action-areas[]" type="checkbox" id="areas_crop_initiatives" value="0" class="type_check" checked="checked" />
    <label for="areas_crop_initiatives">Crop initiatives</label>
</div>
<div>
    <input name="action-areas[]" type="checkbox" id="areas_managment" value="1" class="type_check" checked="checked" />
    <label for="areas_managment">Management</label>
</div>
<div>
    <input name="action-areas[]" type="checkbox" id="areas_assurance" value="2" class="type_check" checked="checked" />
    <label for="areas_assurance">Assurance/certification</label>
</div>
<div>
    <input name="action-areas[]" type="checkbox" id="areas_environmental" value="3" class="type_check" checked="checked" />
    <label for="areas_environmental">Environmental management</label>
</div>
<div>
    <input name="action-areas[]" type="checkbox" id="areas_biodiversity" value="4" class="type_check" checked="checked" />
    <label for="areas_biodiversity">Biodiversity</label>
</div>
<div>
    <input name="action-areas[]" type="checkbox" id="areas_staff" value="5" class="type_check" checked="checked" />
    <label for="areas_staff">Staff</label>
</div>
<div>
    <input name="action-areas[]" type="checkbox" id="areas_community" value="6" class="type_check" checked="checked" />
    <label for="areas_community">Community</label>
</div>


<ul id="case-studies">
    <li id="event_1768" class="ethics_agrochemical_usage ethics_input_costs farms_potatoes areas_crop_initiatives">– Potatoes, Poland</li>
    <li id="event_2190" class="ethics_hcvl farms_beef areas_community areas_managment countries_austria">– Beef, Ireland</li>
    <li id="event_2191" class="ethics_air_emissions farms_tomatoes areas_assurance countries_austria">– Tomatoes, Portugal</li>
</ul>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T11:48:09+00:00Added an answer on May 24, 2026 at 11:48 am

    Just add the class type_hidden to your list items like this:

    <li id="event_1768" class="other classes type_hidden">– Potatoes, Poland</li>
    

    (and than for all list items of course)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a LINQ query from an XML file. I am filtering out certain
I'm attempting to get a set of list items from sharepoint via the WebService.
I am attempting to Filter a large list of tabular data with text keyup.
I have a ASP.Net web page with a grid view. I want to filter
I am attempting to filter a list based on a predicate Func. I use
I'm attempting to intercept and filter items out of a class set array, $this->_vars,
I am attempting to get the list value through a jquery function attached to
I am attempting to get a list of dependable(consistent across requests) list of hidden
I am having trouble with a MOSS FulltextSqlQuery when attempting to filter People results
I am attemting to transition from one UIView to another, when the user rotates

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.