I had to do a lot of form mathematics with javascript, and in order to
force the fields to recognize the fields as numerics instead of strings, I
had to parsefloat() around the value.
So my form fields looked like this.
parseFloat(document.form.field.value) + 1;
In your case, you may have to set your field value into a variable first,
and then parsefloat() around it.
fieldvalue = eval("document.forms[0].interest" + interest + ".value");
"document.forms[0].interest" + interest + ".value" =
parsefloat(fieldvalue) + 1;
I haven't tested that... but parsefloat has always worked for me.
Stuart Duncan
MaracasMedia Inc.
At 12:17 PM 24/05/2001 +0100, you wrote:
>I'm having a mind blank....arghhh. I'm trying to incremtnet the value of a
>control in a form by one where part of the controls name is poassed in as a
>variable. Probably best I explain with the code snippet:
>
>function test(controlnum) {
> "document.forms[0].interest" + interest + ".value" =
>eval("document.forms[0].interest" + interest + ".value") + 1;
>}
>
>I have tested using alert and the The RHS of the equation is computed
>correctly. I need to let javasript know that the LHS of the equation is an
>object in the page rather than just a string but I can't remeber
>how!....anyone help
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists