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;
}
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.
You must log in to post.