jQuery is used to get values from form fields or the document in the DOM.
You use normal Javascript for most basic math functions.
For jQuery help on selectors (need to know your CSS first):
http://api.jquery.com/category/selectors/
To get field values to plug into your formula use $('selector').val:
Code:
$('#element_name').val();
or to convert it to an Integer:
Code:
var myvalue = parseInt($('#element_name').val());
Below is a quick example of how to call jQuery and how functions are loaded and nested and a simple math statement just to show you a high elevation view of syntax:
Code:
<script type="text/javascript">
<!--//
$(function(){
var myvalue1 = parseInt($('#element_name1').val());
var myvalue2 = parseInt($('#element_name2').val());
function calcPrice(){
var rate = 1.5;
var final_value = rate * myvalue1 * myvalue2;
}
calcPrice();
}
});
//-->
</script>
Once you get the concepts of how values are called and pieced together in a jQuery function, the math actually is the easy part. I am not helping you with how to calculate a mortgage - but how to do a math operation based on form or document values using jQuery.
Before responding back (post your relevant code if so) do this first:
1) Add in print values for each value used in your formula and ensure they're set to what they should be
2) Use a browser inspection tool and check console log for JS errors to see if something obviously broken or syntax issue (i.e. chrome, or Firebug in FF)