Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Ok. So I figured it out on my own. </p> <p>Using the maskMoney(), I am able to control what characters are entered and still able to correctly calculate the table.</p> <p>All I had to do to fix the calculations was to unmask the .gasamount:</p> <pre><code> $('.gasamount').unmaskMoney(); </code></pre> <p>This is what fixed the calculation problems. ^^ The mask was causing problems for the total of the 2 rows and those 2 rows caused the calculations to break. </p> <hr> <pre><code> $('.calc').maskMoney({symbol: ""}); $('.R25').unmaskMoney(); $('.R18').unmaskMoney(); $('.calc').keyup(function(){ var classArray = $(this).attr('class').split(' '); //Personal gas expense $('.gasamount').sum("change", "#totals4"); var num = $(this).attr("id").replace(/[A-Za-z$,-]/g, ""); $('#gasmoney'+num).val(&lt;cfoutput&gt;#mileage#&lt;/cfoutput&gt; * $(this).val()); $('.gasmoney').sum("change", "#totals5"); ////////////////////// //Sum of each cell $.each(classArray, function(){ $('.'+this).sum("change", ".ttl"+this); }); //Finding the grandtotal var grandTotal = $('.row26').parent().children('td:last').children('input'); var sum = $('.row25').parent().children('td').children('.calc').sum(); grandTotal.val(Number(sum).toFixed(2)); }); </code></pre> <p>Everyone that tried to help, thank you for taking the time!</p> <p>If anyone would like to use this example or the code for future applications, feel free to comment and let me know and I can setup a different page with an example and instructions and the source. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload