JavaScript table functions

started 6 months ago | 2 posts | 239 views | topic rss | latest reply
  1. I'm trying to learn JavaScript and trying this simple table. I have 2 columns with entries and I would like the last row to add from the cells in the same column. I tried this function but can't seem to get it to work for the life of me. The way I can get it to work is to have 2 functions for each column, which kinda defeats the purpose of a function. I'm sure there's something I'm doing wrong, but I can't find an useful examples. w3schools.com has a very basic example.

    Can someone help or point me in the direction to a solution?

    function AddCosts(Yr,Cost1,Cost2)
    {
    	Cost1 = Cost1 * 1;
    	Cost2 = Cost2 * 1;
    	document.myTbl.Total([Yr]).value = Cost1 + Cost2;
    }

    #
    Curare
    Reputation:8
    Posted 6 months ago

  2. I don't think bbpress can handle html code inside of a code block... it kinda goes nuts.

    We're planning on adding a pastebin type of function to the site for posting code, but we haven't gotten around to it. Maybe you can post your example in one of the many free pastebin sites out there.


    #
    howtogeek
    Reputation:176
    Posted 6 months ago

You must log in to post.

Daily Email Updates

Just want the best posts in your inbox for free? Enter your name and email below:

Name:
Email

About This Topic

Tags

No tags yet.

Our Network
About Productive Geek