View Single Post
Old 09-22-2012, 12:28 AM   PM User | #6
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,172
Thanks: 59
Thanked 3,993 Times in 3,962 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
Maybe you will have to show us the actual page.

Anyway, this is bogus:
Code:
document.getElementById("grandTotal").innerHTML = 
      document.getElementById("grandTotal").innerHTML + churchTotal;
That will *NOT* add the NUMBERS. It will append the strings.

Maybe you could use
Code:
document.getElementById("grandTotal").innerHTML = 
   Number(document.getElementById("grandTotal").innerHTML) + churchTotal;
BUt I'm just having a hard time following the logic of the code.

I don't see why you need the isNaN() checks in there. When will the values being checked ever NOT be numbers??
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote
Users who have thanked Old Pedant for this post:
greenhat (09-28-2012)