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 8593443
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T23:59:24+00:00 2026-06-11T23:59:24+00:00

This question actually applies to filtering using any group of checkboxes. I’m using the

  • 0

This question actually applies to filtering using any group of checkboxes. I’m using the jQuery UI MultiSelect Widget to filter products by class name. My code works great when only one box is checked, but returns no results when more than one is selected. I think I need to map an array somehow, but I’m unsure how to do it. The widget documentation says to do this:

var array_of_checked_values = $("select").multiselect("getChecked").map(function(){
   return this.value;   
}).get();

…but that hasn’t helped me. Please help me get this filter working. Thanks!

<div class="main">
    <article class="contemporary"></article>
    <article class="abstract"></article>
    <article class="impressionist"></article>
</div>

<select id="filterGenre" name="filterGenre" multiple="multiple">
    <option value="abstract">Abstract </option>
    <option value="contemporary">Contemporary </option>
    <option value="impressionist">Impressionist </option>
</select>
<button class="submitFilters" type="button">GO</button>


//creates the multiselect widget: 
$("#filterGenre")
   .multiselect({
      noneSelectedText: 'Select Genre',
      selectedText: 'Select Genre',
      minWidth: 120
   });
//a button to submit the form selections: 
$(function() {
        $( "button.submitFilters" ).button({
            icons: {
                primary: "ui-icon-triangle-1-e"
            },
        });
    });

//the filter actions: 
$('button.submitFilters').click(function() {
        var genreVal = $('#filterGenre').val();
    $('.main article').hide();
    $('.main article[class*=' + genreVal + ']').show();
});
  • 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-06-11T23:59:25+00:00Added an answer on June 11, 2026 at 11:59 pm

    I asked this question with a quarter of the words and got the answer immediately (sometimes that helps). The key to solving this is “.join”… gotta join the array to filter the products by classes. I was defining my “genreVal” variable incorrectly… should be done like this:

    var genreVal = $("#filterGenre").multiselect("getChecked")
                    .map(function(){return "." + this.value; })
                    .get()
                    .join(); //<--the missing link...
    
    //then i used: 
    
        $('.main article').hide();
        $('.main article[class*=' + genreVal + ']').show();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Actually this question applies to any widget that requires data from a remote server.
I'm using Mnesia with Erlang, but this question applies to any key-value db like
Problem This question actually came up at work today. We are planning an experiment
The Question actually says it all. The reason behind this question is I am
The first part of this question is actually a request for confirmation based on
Note: all the quotation marks in this question are actually part of the code.
So, this is actually this question is my current keystone. I'm working on refactoring
This question is more about guidance than actually solving my problem: I need to
I am finally asking this question as I have never actually found an answer.
There are actually 2 question i want to cover in this topic. 1) Is

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.