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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:54:14+00:00 2026-05-23T15:54:14+00:00

I am trying to create some parametric filters but i do not want to

  • 0

I am trying to create some parametric filters but i do not want to invoke the function that makes my search AJAX call when a radio button filter is already selected.

$('#contentType input:enabled').bind('click', function(e){
    var $this = $(this),
        $type = this.type,
        $id = this.id;
    if ($type === 'radio') {
        if ($id === 'allContent'){
            sFrm.$boxes.attr({'checked': false});
            sFrm.$specificRadio.attr({'disabled': true});   
            searchAjax();
            removeFilter();
        }
    } else if ($type === 'checkbox') {
        if (sFrm.$boxes.filter(':checked').length === 0) {
            sFrm.$allRadio.trigger('click');        
        } else {
            var filterConfig = {
                index: $('.subFilter').index($this),
                txt: jQuery.trim($this.parent().text())
            }                   
            sFrm.$allRadio.attr({'checked': false});        
            sFrm.$specificRadio.attr({'disabled': false, 'checked': true}); 
            searchAjax();
            if ($this.is(':checked')) {
                addFilter(filterConfig);
            } else {
                removeFilter(filterConfig.index);
            }               
        }           
    }   
});

So the jQuery above looks at ALL enabled inputs in the collection and when a user clicks the allContent radio button the searchAjax function is invoked.

This is correct when said radio button is not already selected/checked. At the moment the function is still invoked when the button is selected and i would like to stop this behaviour but cannot figure out how?

EDIT

Not sure i explained correctly. Hopefully this jsFiddle will help:

http://jsfiddle.net/QsbRp/3/

Basically if All content types is checked already and is clicked when checked then searchAjax should not be invoked. It currently invokes the function.

When it is not checked and clicked then it should behave as it is now (disable sibling radio button and uncheck all associated checkboxes).

  • 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-23T15:54:14+00:00Added an answer on May 23, 2026 at 3:54 pm

    Add at the top of your handler:

    if ($this.is(":checked")) {
        return;
    }
    

    The event handler will return and not execute the rest of the function if the radio button is currently selected.

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

Sidebar

Related Questions

I am trying to create some MySQL code that will invoke a Java program
i'm trying to create some getters via metaprogramming,but for some reason it does not
I'm trying to create some classes that allow me to retrieve and manipulate a
I'm trying to create some 'friend assemblies' using the [InternalsVisibleTo()] attribute, but I can't
Hi I am trying to create some code that first reads the existing contents
I am trying to create some dynamic DDL to build a function and when
I'm trying to create some nice links over my website. I'm creating a search
Hello I am trying to create some simple pagination, but my php skills are
I'm trying to create some javascript code that will display a javascript form (from
I am trying to create some empty folder in COMMONAPPDATAFOLDER during installation but it

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.