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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T01:17:09+00:00 2026-06-15T01:17:09+00:00

I have this code here which gives a progress bar for check boxes. I

  • 0

I have this code here which gives a progress bar for check boxes. I want to use multiple such progress bars in single page. How do I recall the function uniquely for each div?

$(window).load(function(){
$(function() {
    $("#remind").progressbar({
        value: 0,
        max: 100,
        textFormat: 'fraction',
        complete: function(event, ui) {
            alert("Job complete you lazy bum!");
        }
    });

    $('.option').on('change', function() {
        var total = 0;

        $('.option:checked').each(function() {
            total += parseInt($(this).val());
        });

        $("#remind").progressbar("value", total);
    });

});
});

This is the html part,

<div id="remind"></div>  
<div>
    <input type="checkbox" class="option" value="25"> Task 1<br>
    <input type="checkbox" class="option" value="25"> Task 2<br>
    <input type="checkbox" class="option" value="25"> Task 3<br>
    <input type="checkbox" class="option" value="25"> Task 4<br>
</div>

How do I have another div of same functionality work without interfering the other and yet without writing all the js with changed class and id names.

  • 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-15T01:17:10+00:00Added an answer on June 15, 2026 at 1:17 am

    Well if the div holding the options ALWAYS follow the progressbar div you could use this connection in your script, ( line beginning with: + should be used instead of line with: – )

    instead of id use class “remind”:

    +<div class="remind"></div> 
    -<div id="remind"></div>
    

    initialize progressbar by class instead of id:

    +$(".remind").progressbar({
    -$("#remind").progressbar({
    

    use a localized search for the other checked options inside of the parent (div):

    +$(this).parent().find('.option:checked').each(function() {
    -$('.option:checked').each(function() {
    

    and finally use the HTML structure to increase progress with prev div option:
    *here plays the first sentence of my answer his role

    +$(this).parent().prev('div.remind').progressbar("value", total);
    -$("#remind").progressbar("value", total);
    

    And welcome to stackoverflow! [:

    Here is a jsFiddle to see it work.

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

Sidebar

Related Questions

I have this code here which gives me the result I'm looking for, a
i have this quick issue please. I have this code here which permits me
I have this code here, which is intended to allow any type of arguments:
I have this piece of Open MP code here which performs an integeration of
I have this code down here. When format.js fires I want to serve to
I have this piece of code which gives to SAXParseError i.e., it is not
I have this code which gives me the below output in firebug, so according
i have this code here which outputs me an image.. I need to change
I have this code here, which get a plain text, and turns it to
I have this code, which I found on here, which finds the color of

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.