Hi !
I have a form which has text fields and I got to do some addition based on the values in each textfield. The problem is, Iam using eval(document.formname.elements[index].value) to get the value from each field. It works fine if I enter the number without zero in front i.e., say 345 and 333. But if I enter the same value like this i.e., say 0345 and 333, the sum Iam getting is weird. Since the entered data could also be negative so I cannot use Math.abs also. Is there any way to get the number as it is (even if zero in the beginning) and should also work for negative numbers, also netscape4.71 compatible.
Thanks
Arun
I have a form which has text fields and I got to do some addition based on the values in each textfield. The problem is, Iam using eval(document.formname.elements[index].value) to get the value from each field. It works fine if I enter the number without zero in front i.e., say 345 and 333. But if I enter the same value like this i.e., say 0345 and 333, the sum Iam getting is weird. Since the entered data could also be negative so I cannot use Math.abs also. Is there any way to get the number as it is (even if zero in the beginning) and should also work for negative numbers, also netscape4.71 compatible.
Thanks
Arun