K
Kenny
I've run into this problem a couple of times. When I try to get a
value from a form text field and add them together like so…
a = document.myform.field1.value
b = document.myform.field2.value
c = a + b
document.myform.field3.value = c
It treats the values as a string and if the input numbers are 2 and 4
I get 24 and not 6 like I would expect.
I can do some crazy math to force it to recognize the numbers like
this…
c = (a*10/10) + (b*10/10)
and get the results I want, because when I use multiplication and
division, it recognizes the numbers as numbers. But dose anyone know
how to get it to recognizes the numbers in the first place.
Thanks
Kenny
value from a form text field and add them together like so…
a = document.myform.field1.value
b = document.myform.field2.value
c = a + b
document.myform.field3.value = c
It treats the values as a string and if the input numbers are 2 and 4
I get 24 and not 6 like I would expect.
I can do some crazy math to force it to recognize the numbers like
this…
c = (a*10/10) + (b*10/10)
and get the results I want, because when I use multiplication and
division, it recognizes the numbers as numbers. But dose anyone know
how to get it to recognizes the numbers in the first place.
Thanks
Kenny