[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to add numbers?


Sounds to me like somewhere along the line you pulled the numbers out of an 
input field before processing them.  If text field 1 contained 3 and text 
field 2 contained 6, then adding them would be the equivalent of adding the 
strings "3" and "6" to get "36" not "9".  Try this:

var myVal1=eval(window.forms["myform"].myfield1.value);
var myVal2=eval(window.forms["myform"].myfield2.value);
var result=myVal1+myVal2;

-- Kurt Cagle
Cagle Communications