I've developed a Javascript code that calculates the total linear footage based on values entered by the user. Below is the snippet of the JavaScript code...
var totalLinealFootage = 0;
for (var i = 0; i <= 24; ++i)
{
var p = +document.getElementById('pf' + i).value;
var f = +document.getElementById('ff' + i).value;
var i = (+document.getElementById('if' + i).value)/12;
if (!isNaN(p) && !isNaN(f) && !isNaN(i))
{
totalLinealFootage += (f+i)*p;
}
}
Currently, regardless of the input values I provide, the totalLinealFootage variable remains undefined. What could be causing this issue?