User Profile

Collapse

Profile Sidebar

Collapse
wearsheep
wearsheep
Last Activity: Dec 28 '09, 06:32 PM
Joined: Dec 11 '09
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • wearsheep
    replied to Javascript: Sum up columns of a table
    So I've pretty much figured this one out but am still trying to allow only numeric entries (including decimals)...

    ended up abandoning the 2xArray and decided to just loop through each value for a given row/column - so far, so good.

    One odd thing - the columns wouldn't total until I placed that loop first - any ideas on why that would be?

    Javascript
    Code:
    function calculate(col, row){
    var numericExpression
    ...
    See more | Go to post

    Leave a comment:


  • wearsheep
    replied to Javascript: Sum up columns of a table
    two dimensional associative array

    Thanks again, acoder.

    (FYI: I really don't know javascript so try not to laugh at this pitiful effort)

    Here's an attempt at using an array to calculate row/col values. BTW: The column headers are paycodes not just some seeminly random selection of numbers
    .
    Javascript
    Code:
    <script type="text/JavaScript">
    function calcTotal(cell,row,col){
    ...
    See more | Go to post

    Leave a comment:


  • wearsheep
    replied to Javascript: Sum up columns of a table
    Thanks, acoder.

    I figured out a solution for the original question and I managed to edit the preceding code to total both rows and columns.

    Here's the next question: can this be further altered so that changes to the fields can be counted - right now it just keeps adding to the totals but I want it to keep a running total of the current numbers only.

    Possible?

    Javascript
    Code:
    
    
    ...
    See more | Go to post

    Leave a comment:


  • wearsheep
    replied to Javascript: Sum up columns of a table
    This second solution works really well except (and my javascript understanding is almost nil) the NaN comes up if a field is tabbled through/nothing is entered in a box...

    How can that be addressed?

    Thank you.
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...