B
BC
I have read the FAQ and the discussions but I am not a Javascript
programmer and do not know how to make toFixed (and other techniques)
work, after several attempts.
The following calculations work when the form is submitted (and maybe
they should not...), but I do not know how to add a Rounding function
to the existing code, so that each Result is Rounded to 2 decimal
places.
toFixed sounds like it would be ideal...
<input type="submit" value="Submit CCI - for Maximum of 10 Items"
name="SubmitCCI001"
onClick="
this.form._15_1_Total.value = ((this.form._13_1_Quantity.value -
0) * (this.form._14_1_UnitPrice.value - 0));
this.form._15_2_Total.value = ((this.form._13_2_Quantity.value -
0) * (this.form._14_2_UnitPrice.value - 0));
this.form._15_3_Total.value = ((this.form._13_3_Quantity.value -
0) * (this.form._14_3_UnitPrice.value - 0));
this.form._15_4_Total.value = ((this.form._13_4_Quantity.value -
0) * (this.form._14_4_UnitPrice.value - 0));
this.form._15_5_Total.value = ((this.form._13_5_Quantity.value -
0) * (this.form._14_5_UnitPrice.value - 0));
this.form._15_6_Total.value = ((this.form._13_6_Quantity.value -
0) * (this.form._14_6_UnitPrice.value - 0));
this.form._15_7_Total.value = ((this.form._13_7_Quantity.value -
0) * (this.form._14_7_UnitPrice.value - 0));
this.form._15_8_Total.value = ((this.form._13_8_Quantity.value -
0) * (this.form._14_8_UnitPrice.value - 0));
this.form._15_9_Total.value = ((this.form._13_9_Quantity.value -
0) * (this.form._14_9_UnitPrice.value - 0));
this.form._15_10_Total.value = ((this.form._13_10_Quantity.value
- 0) * (this.form._14_10_UnitPrice.value - 0));
this.form._17_InvoiceTotal.value = ((this.form._15_1_Total.value - 0) +
(this.form._15_2_Total.value - 0) + (this.form._15_3_Total.value - 0) +
(this.form._15_4_Total.value - 0) + (this.form._15_5_Total.value - 0) +
(this.form._15_6_Total.value - 0) + (this.form._15_7_Total.value - 0) +
(this.form._15_8_Total.value - 0) + (this.form._15_9_Total.value - 0) +
(this.form._15_10_Total.value - 0));
">
Thank you for your patience, Bryan
programmer and do not know how to make toFixed (and other techniques)
work, after several attempts.
The following calculations work when the form is submitted (and maybe
they should not...), but I do not know how to add a Rounding function
to the existing code, so that each Result is Rounded to 2 decimal
places.
toFixed sounds like it would be ideal...
<input type="submit" value="Submit CCI - for Maximum of 10 Items"
name="SubmitCCI001"
onClick="
this.form._15_1_Total.value = ((this.form._13_1_Quantity.value -
0) * (this.form._14_1_UnitPrice.value - 0));
this.form._15_2_Total.value = ((this.form._13_2_Quantity.value -
0) * (this.form._14_2_UnitPrice.value - 0));
this.form._15_3_Total.value = ((this.form._13_3_Quantity.value -
0) * (this.form._14_3_UnitPrice.value - 0));
this.form._15_4_Total.value = ((this.form._13_4_Quantity.value -
0) * (this.form._14_4_UnitPrice.value - 0));
this.form._15_5_Total.value = ((this.form._13_5_Quantity.value -
0) * (this.form._14_5_UnitPrice.value - 0));
this.form._15_6_Total.value = ((this.form._13_6_Quantity.value -
0) * (this.form._14_6_UnitPrice.value - 0));
this.form._15_7_Total.value = ((this.form._13_7_Quantity.value -
0) * (this.form._14_7_UnitPrice.value - 0));
this.form._15_8_Total.value = ((this.form._13_8_Quantity.value -
0) * (this.form._14_8_UnitPrice.value - 0));
this.form._15_9_Total.value = ((this.form._13_9_Quantity.value -
0) * (this.form._14_9_UnitPrice.value - 0));
this.form._15_10_Total.value = ((this.form._13_10_Quantity.value
- 0) * (this.form._14_10_UnitPrice.value - 0));
this.form._17_InvoiceTotal.value = ((this.form._15_1_Total.value - 0) +
(this.form._15_2_Total.value - 0) + (this.form._15_3_Total.value - 0) +
(this.form._15_4_Total.value - 0) + (this.form._15_5_Total.value - 0) +
(this.form._15_6_Total.value - 0) + (this.form._15_7_Total.value - 0) +
(this.form._15_8_Total.value - 0) + (this.form._15_9_Total.value - 0) +
(this.form._15_10_Total.value - 0));
">
Thank you for your patience, Bryan