Does anybody see why this script would not work?
Code:<script language="JavaScript">
function calc(form)
{
var perc;
perc = Number(perc);
perc = 0;
var inputFields = document.all.tags("INPUT");
for(i=0; i < inputFields.length; i++)
{
if(inputFields[i].value != "")
{
if(inputFields[i].name != 'locID')
{}
if(inputFields[i].name != 'locCode')
{}
if(inputFields[i].name != 'org')
{}
if(inputFields[i].name != 'region')
{}
if(inputFields[i].name != 'percVal')
{}
if(inputFields[i].name != 'addIT')
{}
if(isNaN(inputFields[i].value) == true)
{
alert("You have input something other than a number, please input numbers only!");
return false;
}
else
{
var num;
alert("HI");
num = inpurFields[i].value;
num = Number(num);
perc = perc + num;
}
}
}
if(perc < 100)
{
alert("The percentages are less than 100, please check your numbers and re-submit")
return false;
}
else if(perc > 100)
{
alert("The percentages are more than 100, please check your numbers and re-submit")
return false;
}
}
</script>
