I'm trying to make a calculation using number fields that have set decimal places.
While the decimals are being displayed properly, the calculation is not running. Here is my javascript:
function setZeroNumberDecimal(el) {
el.value = parseFloat(el.value).toFixed(0);
};
function setThreeNumberDecimal(el) {
el.value = parseFloat(el.value).toFixed(3);
};
$(document).ready(function(){
$(".calc").keyup(function(){
var areasf = +$(".SF").val();
$("#acre").val(areasf/43560);
});
});
And the HTML:
<input type="number" onchange="setZeroNumberDecimal(this)" name="grosslandSF" class="calc SF">
<input type="number" onchange="setThreeNumberDecimal(this)" name="grosslandacre" disabled="disabled" id="acre">
Any help would be great.