JQuery Calculator not working

Posted by user2798091 on Stack Overflow See other posts from Stack Overflow or by user2798091
Published on 2014-05-29T09:13:37Z Indexed on 2014/05/29 9:25 UTC
Read the original article Hit count: 111

Filed under:

I am trying to build a tile calculator but can't seem to get the following code to work:

JQuery:

$(document).ready(
    function caculateForm() {
        var length = document.getElementById('length').value;
        var width = document.getElementById('width').value;
        var size = document.getElementById('size').value;
        var compute = (length * width) / (size / 100);
        var total = compute * 100;
        var allowance = (compute * 100) * .10;
        allowance = Math.floor(total) + Math.floor(allowance + 1);
        document.getElementById('total').value = Math.floor(total);
        document.getElementById('allowance').value = allowance;
    }
});


$(document).ready(
    function clearFileInput(id) {
        var elem = document.getElementById(id);
        elem.parentNode.innerHTML = elem.parentNode.innerHTML;
    }
});

Here is my jsfiddle

© Stack Overflow or respective owner

Related posts about jQuery