This is real quick & dirty, but it should get you started. Since you indicated a fixed number of input boxes, I went this route. If you setup the page for 50 inputs, you'll need to change the condition of the FOR loop to "x<51".
I hope this helps!
Code:
<script type="text/javascript" language="javascript">
function calculate(){
var counter = 0;
var total = 0;
for(x=1;x<16;x++){
if(!isNaN(parseInt(document.getElementById(x).value))){
total = total + parseInt(document.getElementById(x).value);
counter++
}
}
if(counter > 0){
document.getElementById('average').value = "" + (total/counter);
}
}
</script>
</head>
<body>
<input type="text" name="textfield" id="1" onKeyUp="calculate();">
<br>
<input type="text" name="textfield" id="2" onKeyUp="calculate();">
<br>
<input type="text" name="textfield" id="3" onKeyUp="calculate();">
<br>
<input type="text" name="textfield" id="4" onKeyUp="calculate();">
<br>
<input type="text" name="textfield" id="5" onKeyUp="calculate();">
<br>
<input type="text" name="textfield" id="6" onKeyUp="calculate();">
<br>
<input type="text" name="textfield" id="7" onKeyUp="calculate();">
<br>
<input type="text" name="textfield" id="8" onKeyUp="calculate();">
<br>
<input type="text" name="textfield" id="9" onKeyUp="calculate();">
<br>
<input type="text" name="textfield" id="10" onKeyUp="calculate();">
<br>
<input type="text" name="textfield" id="11" onKeyUp="calculate();">
<br>
<input type="text" name="textfield" id="12" onKeyUp="calculate();">
<br>
<input type="text" name="textfield" id="13" onKeyUp="calculate();">
<br>
<input type="text" name="textfield" id="14" onKeyUp="calculate();">
<br>
<input type="text" name="textfield" id="15" onKeyUp="calculate();">
<br>
<br>
<input type="text" name="average" id="average">
Bookmarks