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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T19:17:42+00:00 2026-05-30T19:17:42+00:00

I am working with the jQuery Calculation Plugin on a page where I do

  • 0

I am working with the jQuery Calculation Plugin on a page where I do quantity x price calculations that then add to a subtotal. This is repeated 4 times.

Each set of 4 involve fields with different ids and differing calculations (more than just price x qty).

The id’s of the 4 subtotal fields are subtotal_events, subtotal_raffle, subtotal_sdc, subtotal_late.

In addition to displaying the individual subtotals, I need to display a “grand total”…a total of the subtotals.

In the fiddle referenced below, I’ve hard-coded the values of two of the 4 subtotals.

I’ve also created a function recalc3, which is currently producing the NaN in the #grandtotal span. The value should be $70 based upon the hard-coded subtotals, even if no tours or extra tickets are ordered.

Hours of reading posts and trial and error aren’t getting me any closer, so any help with achieving the goal is very much appreciated.

Here’s the fiddle: http://jsfiddle.net/sadiem/7spHt/

  • 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-30T19:17:44+00:00Added an answer on May 30, 2026 at 7:17 pm

    You are trying to extract the text in SPAN element, but are using the $(this).val function.
    Use $(this).text function and also remove the $ symbol in the text before parsing as float.

    Updated jsFiddle: http://jsfiddle.net/7spHt/9/

    $("[id^=subtotal_]").each(function() {
      var fee = parseFloat($(this).text().replace("$", ""));
      grandtotal += fee;
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on a small jQuery plugin that autoscrolls through a set of
Still working through JQuery to get data and repopulate portions of a page. Right
I have this code which is not working jQuery if($(#dis(h3)).length == 0) $(#dis).append(<p>no display</p>);
On IE I can do this with the (terribly non-standard, but working) jQuery if
I'm using the jQuery calculation and have just about everything working properly, but I
I have got this project that uses excel for some calculation. This excel is
Working against jQuery 1.3.2 I'm looking for best practices that implement the typical '
All, I'm working on an HTML page that includes a large data table. As
I'm working on a Codeigniter application and in a page I'm using jQuery to
I have been working with Gilbert Pellegrom JQuery Currency plugin, to convert prices on

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.