Use parseInt to make the textfield values be interpreted as numbers instead of strings:
code:
myTot_var = parseInt(h1_var)+parseInt(h2_var)+parseInt(h3_var)
If they are floating points, use parseFloat. You can also use:
code:
new Number(h1_var)
|
Results 1 to 4 of 4
Thread: getting sum of input text fieldsThreaded View
|
Click Here to Expand Forum to Full Width |