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

  • SEARCH
  • Home
  • 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 739651
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T08:25:30+00:00 2026-05-14T08:25:30+00:00

Though I don’t doubt this has been answered I cannot find a great match

  • 0

Though I don’t doubt this has been answered I cannot find a great match for my question.

I have a table for which I’d like to filter rows based on whether or not they contain a hidden field matching a value.

I understand that the technique tends to be “show all rows”, “filter the set”, “show/hide that filtered set”

I have the following jquery but I’m aweful with filter and my filtered set seems to always contain no elements.

my table is the usual

<table>
<tr><td>header></td><td>&nbsp;</tr>
<tr>
<td>a visible cell</td><td><input type='hidden' id='big-asp.net-id' value='what-im-filtering-on' />
</td>
</tr>
</table>

My goal is to be able to match on tr who’s descendent contains a hidden input containing either true or false.

this is how I’ve tried the selector (variations of this) and I’m not even testing for the value yet.

function OnFilterChanged(e){
    //debugger;
    var checkedVal = $("#filters input[type='radio']:checked").val();
    var allRows = $("#match-grid-container .tabular-data tr");
    if(checkedVal=="all"){        
         allRows.show();
    }
    else if(checkedVal=="matched"){
         allRows.show();
         allRows.filter(function(){$(this).find("input[type='hidden'][id~='IsAutoMatchHiddenField']")}).hide();

    }
    else if(checkedVal=="unmatched"){

    }
}

Am I way off with the filter? is the $(this) required in the filter so that i can do the descendant searching?

Thanks kindly

Building upon those great suggestions below I have found that the following does the trick. I’d missed the fact that the filter closure function must return true/false based on the filter condition. Also, that the ends-with selector is great for asp.net generated ids based on INamingContainer

allRows.show();
allRows.filter(function(){
            return $(this).find(
               "input[type='hidden'][id$='IsAutoMatchHiddenField']").val() == "False";
         }).hide();
  • 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-14T08:25:31+00:00Added an answer on May 14, 2026 at 8:25 am
    $('#mySelector :hidden').filter(
        function (index)
        {
            return $(this).find('.repeatedObject').val() == 'someValue';
        }
    ).hide();
    

    The filter() function needs a boolean to be returned to actually determine whether or not to leave an element in the list. Check the API (http://api.jquery.com/filter/) for more information.

    Also, as a sidenote, the val(), html(), text(), and other related functions return the information from the first element in the set. If you want to loop through, you’d have to use each or a for loop.

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

Sidebar

Related Questions

Hopefully this is an easy one - though I don't seem to have much
My program (which happens to be in Perl, though I don't think this question
I don't get why this confirm() call fires up even though i hit no.
I have a dillema where our client relations department has been brought in for
#ifdef _cplusplus #include headerfile.h #endif I understand the concept behind this, though I don't
This may be a result of misuse of the component, though I don't think
I don't currently use ajax.net though I would be open to it if it
I fully appreciate the atomicity that the Threading.Interlocked class provides; I don't understand, though,
I thought this was covered elsewhere but I don't see it now. Anyway, having
I don't think this is possible but I thought I'd throw it out there.

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.