I'm having difficulties arithmetically manipulating form element values.
I've entered data into the form, and I fetch them using a js, as:
p7Left = Number(document .form1.elements["p7_left"].value);
p7Right = Number(document .form1.elements["p7_right"].value);
...
...
scoreLeft = Number(document .form1.elements["left_score "].value);
scoreRight = Number(document .form1.elements["right_scor e"].value);
Then I add these as follows:
scoreLeft = Number(scoreLef t + p&Left + ...... +);
This does what I want; without the operator 'Number' I get a concatination
of the various variables (as expected). Is there some way of globally
defining all variables as numbers instead of strings?
--
Ed Jay (remove M to respond by email)
I've entered data into the form, and I fetch them using a js, as:
p7Left = Number(document .form1.elements["p7_left"].value);
p7Right = Number(document .form1.elements["p7_right"].value);
...
...
scoreLeft = Number(document .form1.elements["left_score "].value);
scoreRight = Number(document .form1.elements["right_scor e"].value);
Then I add these as follows:
scoreLeft = Number(scoreLef t + p&Left + ...... +);
This does what I want; without the operator 'Number' I get a concatination
of the various variables (as expected). Is there some way of globally
defining all variables as numbers instead of strings?
--
Ed Jay (remove M to respond by email)
Comment