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="SubmitCCI 001"
onClick="
this.form._15_1 _Total.value = ((this.form._13 _1_Quantity.val ue -
0) * (this.form._14_ 1_UnitPrice.val ue - 0));
this.form._15_2 _Total.value = ((this.form._13 _2_Quantity.val ue -
0) * (this.form._14_ 2_UnitPrice.val ue - 0));
this.form._15_3 _Total.value = ((this.form._13 _3_Quantity.val ue -
0) * (this.form._14_ 3_UnitPrice.val ue - 0));
this.form._15_4 _Total.value = ((this.form._13 _4_Quantity.val ue -
0) * (this.form._14_ 4_UnitPrice.val ue - 0));
this.form._15_5 _Total.value = ((this.form._13 _5_Quantity.val ue -
0) * (this.form._14_ 5_UnitPrice.val ue - 0));
this.form._15_6 _Total.value = ((this.form._13 _6_Quantity.val ue -
0) * (this.form._14_ 6_UnitPrice.val ue - 0));
this.form._15_7 _Total.value = ((this.form._13 _7_Quantity.val ue -
0) * (this.form._14_ 7_UnitPrice.val ue - 0));
this.form._15_8 _Total.value = ((this.form._13 _8_Quantity.val ue -
0) * (this.form._14_ 8_UnitPrice.val ue - 0));
this.form._15_9 _Total.value = ((this.form._13 _9_Quantity.val ue -
0) * (this.form._14_ 9_UnitPrice.val ue - 0));
this.form._15_1 0_Total.value = ((this.form._13 _10_Quantity.va lue
- 0) * (this.form._14_ 10_UnitPrice.va lue - 0));
this.form._17_I nvoiceTotal.val ue = ((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="SubmitCCI 001"
onClick="
this.form._15_1 _Total.value = ((this.form._13 _1_Quantity.val ue -
0) * (this.form._14_ 1_UnitPrice.val ue - 0));
this.form._15_2 _Total.value = ((this.form._13 _2_Quantity.val ue -
0) * (this.form._14_ 2_UnitPrice.val ue - 0));
this.form._15_3 _Total.value = ((this.form._13 _3_Quantity.val ue -
0) * (this.form._14_ 3_UnitPrice.val ue - 0));
this.form._15_4 _Total.value = ((this.form._13 _4_Quantity.val ue -
0) * (this.form._14_ 4_UnitPrice.val ue - 0));
this.form._15_5 _Total.value = ((this.form._13 _5_Quantity.val ue -
0) * (this.form._14_ 5_UnitPrice.val ue - 0));
this.form._15_6 _Total.value = ((this.form._13 _6_Quantity.val ue -
0) * (this.form._14_ 6_UnitPrice.val ue - 0));
this.form._15_7 _Total.value = ((this.form._13 _7_Quantity.val ue -
0) * (this.form._14_ 7_UnitPrice.val ue - 0));
this.form._15_8 _Total.value = ((this.form._13 _8_Quantity.val ue -
0) * (this.form._14_ 8_UnitPrice.val ue - 0));
this.form._15_9 _Total.value = ((this.form._13 _9_Quantity.val ue -
0) * (this.form._14_ 9_UnitPrice.val ue - 0));
this.form._15_1 0_Total.value = ((this.form._13 _10_Quantity.va lue
- 0) * (this.form._14_ 10_UnitPrice.va lue - 0));
this.form._17_I nvoiceTotal.val ue = ((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
Comment