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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T04:33:41+00:00 2026-06-14T04:33:41+00:00

I have numerous checkboxes that are prices and what I’ve tried to do is

  • 0

I have numerous checkboxes that are prices and what I’ve tried to do is the following

When someone selects a prices/checkbox, it will automatically check the values that are less than the selected value.

JsFiddle

HTML

<div class="prices">
    <input type="checkbox" value="59.99" />59.99
    <input type="checkbox" value="69.99" />69.99
    <input type="checkbox" value="79.99" />79.99
    <input type="checkbox" value="89.99" />89.99
    <input type="checkbox" value="99.99" />99.99
    <input type="checkbox" value="124.99" />124.99
    <input type="checkbox" value="149.99" />149.99
    <input type="checkbox" value="199.99" />199.99
    <input type="checkbox" value="200.00" />200.00
</div>
​

JQUERY

$('.prices input[type=checkbox]').live('click', function (){
     console.log(this);
     $(this).attr('checked', true);
     var chosenPrice = $(this).val();
     console.log(chosenPrice);
     $(".prices input").filter(function(){ 
     return  $(this).attr("value") <=chosenPrice}).attr('checked', true);
});​

It selects some values but it doesn’t seem to work as it should be. check out the fiddle

  • 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-14T04:33:43+00:00Added an answer on June 14, 2026 at 4:33 am

    Modified part of your code.. You need to do only check the other checkboxes when the current checkbox is checked..
    Also need to convert the string to a number using

    parseFloat() or Number()

    $('.prices input[type=checkbox]').live('click', function() {
        console.log(this);
        var $this = $(this) ;
        if ($this.is(':checked')) {
            var chosenPrice = $this.val();
            console.log(chosenPrice);
            $(".prices input").filter(function() {
                return parseFloat($(this).attr("value")) <= chosenPrice
            }).prop('checked', true);
        }
    });​
    

    Check Fiddle

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

Sidebar

Related Questions

I have to make mutually exculsive checkboxes. I have come across numerous examples that
I'm creating a Django powered website that will have numerous applications (Blog, Shop, Portfolio,
I have numerous csv files that will form the basis of a mysql database.
I have numerous functions (unknown at design time) that each take a specific number
In my program I have numerous Entity classes with a Texture2D attribute that are
I have read numerous people with this question and have tried numerous strategies. However,
I have numerous occurrences of the following in my code: this.webBrowserCtrl.DocumentCompleted -= new System.Windows.Forms.WebBrowserDocumentCompletedEventHandler(this.LoginScreenLoaded);
I have numerous buttons that go to different views on my main page and
In my Rails 3 application I have numerous models that have columns that have
I am building a php+mysql site which will have numerous articles. I am pretty

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.