I have a table where users can enter a part number, part price and quantity. It then multiple's the price and the quantity to get you a total. I got this part up and running.
Now i have to get the taxes on the part and then a grand total but this is what im getting:
function calculateit() {
var myBox1 = $( 'input[name=tax2]:checked' ).val(); //taxes value
var myBox2 = document.getElementById('partstotalvalue').value; //parts total value
var result = document.getElementById('partstax'); // input field for the total of taxes * parts
var myResult = myBox1 * myBox2; //result = taxes * parts total
result.value = myResult; // display the results
var result2 = document.getElementById('partstotalwithtax'); // inputp field for taxes + total value
var totalResult = myResult + myBox2; // totalresult = taxes on part + the parts total
result2.value = totalResult; // display the results
}
Here's the fiddle: