The reason the code doesn't work is that the autocalculation takes place as soon as the JS runs, and returns the less10 field to its former value. There's no error, other than it doesn't do what you want.
To fix it, you can move the calculation script to a validation script. This will mean that it won't calculate until you tab through the "less10" field. Probably too much of a PIA, but it will enable your button and its JS to work the way you want.
OTOH, you could leave the calculation script where it is, and make it conditional:
var c = a.value * b.value;
if (c < =10) c = 0;
event.value = c;
Then simply remove the button; it won't be needed any more unless you need to see the first calculation.
On Friday, Jun 20, 2003, at 14:32 US/Central, [EMAIL PROTECTED] wrote:
David-Jim Plante
This code didn't work but it didn't return an error so I think the problem may still lie in the pathway of the code.�"less10" field is autocalc which multiplies two other fields to get its total:�
Vara = this.getField("retrate");
Varb = this.getField("comptot");
Event.value= a.value * b.value;
Is there a way to still zero out this field even though its end product is a result of the above calculation.�Thank you for your help!
�
<[EMAIL PROTECTED]>
