My form calculations work in my jsfiddle, however in my wordpress page, it says Uncaught TypeError: Cannot set property 'onchange' of null
. Is my page not loading the function when it loads?
(javascript in the header)
function doTotal(form) {
var a = (+form.halfday1.value);
var b = (+form.fullday1.value);
form.total1.value = a + b ;
}
document.getElementById("quote").onchange = function (){doTotal(this)};