My question is so close to this that it is amazing. I need to total all
cells in a column of a table and I have encountered the same problem.
Unfortunately I do not know how to "Eschew surplusage", so I will post a
fresh question.
Quote:
> Mar 2002 15:25:37 :-
> >I have a series of <INPUT TYPE="text"> boxes that I want to sum up. When
I
> >do
> >document.all("txtWhatever").value I get back a string so that:
> >var total = 0;
> >for(i=1; i<19; i++) {
> > total = total + document.all("txtWhatever").value;
> >}
> >concatenates two strings instead of adding two numbers.
> Eschew surplusage; just change the + to + + for which the second + must
> be a unary + which can only result in a number.
> --
MSIE 4 ?
> <URL:http://www.jibbering.com/faq/> FAQ for comp.lang.javascript by Jim
Ley.
> <URL:http://www.merlyn.demon.co.uk/js-index.htm> JS maths, dates,
sources.
> <URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/JS/&c., FAQ topics,
links.