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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T15:25:02+00:00 2026-06-16T15:25:02+00:00

I have a jsfiddle here . In the fiddle there is a number of

  • 0

I have a jsfiddle here.

In the fiddle there is a number of mark textboxes. Type a number in the text box and keep clicking on the add question button. You will see that the total marks remaining equals 10 but it doesn’t change. The number of marks remaining should change by subtracting each number in the appended row.

For example, if total marks remaining is 10 and you append four rows, each row containing marks of 1, then total marks remaining should be 6. (10 - 4 = 6.) But why is it not changing the number of marks remaining?

This is the function where it performs the calculation:

function calculateTotal()
{
   var totalweight = totalmarks;
   $("#qandatbl td.weight input").each(function (i, elm){
        totalweight = totalweight - Number($(elm).val(), 10);
    });

    $("#total-weight").text(totalweight);
}
  • 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-16T15:25:04+00:00Added an answer on June 16, 2026 at 3:25 pm

    According to your jsfiddle you dont have inputs inside table#quandatbl.
    Try change function to

    function calculateTotal()
    {
       var totalweight = totalmarks;
       $("#qandatbl_onthefly_container td.weight input").each(function (i, elm){
            totalweight = totalweight - Number($(elm).val(), 10);
        });
    
        $("#total-weight").text(totalweight);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jsfiddle here . jQuery $(function() { //var input = $('form :input[type=text]')
I have a Jsfiddle application here . If you type in a question in
Fiddle here: http://jsfiddle.net/csaltyj/mbnWm/ <style type=text/css> #container { border: 2px solid #000; position: absolute; width:
I have a jsfiddle here http://jsfiddle.net/cbyJD/76 As you can see in the fiddle there
I have a fiddle here - http://jsfiddle.net/hhimanshu/SDr3F/2/ The left pane is already available I
I have a fiddle here http://jsfiddle.net/WULsZ/1/ I load jQuery first and the code is
I have a CSS mouseover slider fully functional here http://jsfiddle.net/gU4sw/13/ . When I add
JSfiddle: http://jsfiddle.net/ybZvv/57/ I have a fiddle here where the user can append row and
I have a jsfiddle here: http://jsfiddle.net/ybZvv/61/ Please follow steps in fiddle: When you open
I have a fiddle here, very simple one. http://jsfiddle.net/tnQne/ The js I have is

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.