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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T14:15:25+00:00 2026-05-31T14:15:25+00:00

I am having issues with something that seems like it should be pretty easy

  • 0

I am having issues with something that seems like it should be pretty easy to do with JQuery. Basically I have a table on my page. Each row on the table has a check box and a cell for an amount. I am trying to write a function that will traverse each row and check to see if the checkbox is checked off. If so it will add the amount to my total so I can show it at the bottom of my page. For some reason I can’t find my checkbox. Below is the html on the page.

<div class="BillAccordian">
<h3><A href="#">Past Due Bills - Total $ 1047.62 </A></h3>
<div>
    <table style="background-color:Red">


    <tr>
        <td>
            <input class="RowSelector" id="BillInfo_PastDueBills_0__Selected" name="BillInfo.PastDueBills[0].Selected" type="checkbox" value="true" />
            <input name="BillInfo.PastDueBills[0].Selected" type="hidden" value="false" /> 
        </td>
    <td>
        RE 
    </td>
    <td>
        334 
    </td>

    <td>
        1047.62 
    </td>
    <td>
        Bill Number 20121 
    </td>
</tr> 
        </table>
    </div>
</div> 

Here is the JQuery script I am using right now to try to accomplish this

$('input.RowSelector').click(function () {
        var sum = 0;
        alert("1");
        // we want to sum up the values of all input.sum elements that are in the same tr
        // as this one
        $('tr').each(function (e) {
            var val;
            alert($(this).find(".RowSelector")[0].is(':checked'));
            if ($(this).closest("input.RowSelector").val() == true) {
                alert("3");
                //                val = parsefloat($(i).find(".BillAmount").val());
                //            
                //                if (isNaN(val) || val === undefined) {
                //                    return;
            }

            //                sum += val;
        });
        //            $(this).find('#SelectedTotal').val(formatDollar(sum));
    });
}); 

A lot of it is commented out right now becuase I am just tyring to get a hold of the selector I need to continue on. Using the alert in the function I get nothing. I think it does not like the [0] I tacked on but using find wihtout it I kept getting back nothing. I did check my $this.html to make sure i had the correct element and it did return the entire table row with the checkbox inside so I am stumped at this point. Can someone tell me what I am missing?

Thanks

  • 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-31T14:15:27+00:00Added an answer on May 31, 2026 at 2:15 pm
    $('tr').each(function (e) {
       if ($(this).find('input:checked').length > 0)
       {
          // Do calculation
       }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having an issue when trying to do something which should be as easy
Im having issues getting this to work, maybe its not even possible? I have
Let us say we have some code that looks like below: @interface SomeClass :
Having a weird issue. I'm new to Macs and have a windows VM that
I'm having a hard time getting my head around what seems like an obvious
I'm trying to get something set up in a DataGridView . It seems like
Having issues referencing $(this) from within a the nested ajax 'success' function... I know
Still having issues with this problem. Please help if you can. So I am
Im having issues vertically positioning text inside of a text input field in Firefox.
I'm having issues with my SQL Reporting Services reports. I'm using a custom font

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.