1. occhio a <title>
2. length non lenght
3. occhio alla parentesi dell IF
codice:
<HTML>
<HEAD>
<TITLE></TITLE>
<SCRIPT>
function somma(obj) {
t = 0
e = obj.elements;
for (i=0;i<e.length-1;i++) {
if (e[i].name.substr(0,7)=="Consumo") t += parseFloat(e[i].value)
}
obj.CampoTotale.value=t
}
</SCRIPT>
</head>
<body>
<FORM name="form" method="post" action="Salva.asp">
<td class="testo8" height="20" bgcolor="#D3E1FA" width="145">
<input type="text" name="Consumo1" size="11" maxlength="15" class="form" onblur="somma(this.form)">
</td>
<td class="testo8" height="20" bgcolor="#D3E1FA" width="145">
<input type="text" name="Consumo2" size="11" maxlength="15" class="form" onblur="somma(this.form)">
</td>
<td class="testo8" height="20" bgcolor="#D3E1FA" width="145">
<input type="text" name="Consumo29" size="11" maxlength="15" class="form" onblur="somma(this.form)">
</td>
</table>
<input type="text" name="CampoTotale" size="25" class="form" readonly>
</FORM>
</BODY>
</HTML>