View Full Version : How to fix this error

06-18-2007, 05:28 AM
I encounter the some problem while adding the array elements like

when a[i]=1 b[i]=2 c[i]=3, it makes h[i]=123

It treats the array elements as characters.
I use
<input type="text"> command to insert elements into arrays...

Plz anyboby help.....

06-18-2007, 06:18 AM
Inputs are strings by default. You need to use parseInt(a[i]) + parseInt(b[i]) + parseInt(c[i]).

06-18-2007, 03:01 PM
Wow.....That really worked buddy. Thanks a lot for your help.

Im a begineer in this language. I got nice infos from this web, keep up the work.

If i encounter any errors, i will consult u.

Thanks a lot.

*Topic to be lOcKeD*