Ciao a tutti, avete idea del perchè questo script funzioni su firefox e non su explorer? Credo sia un problema di sintassi:
Codice PHP:
<script type="text/JavaScript">
<!--
// Numero totale offerte
function calcola(i) {
prezzo = String('prezzo'+i);
prezzo = document.getElementById(prezzo).value;
prezzo = prezzo.replace(/\,/g , ".");
quantita = String('quantita'+i);
quantita = document.getElementById(quantita).value;
quantita = quantita.replace(/\,/g , ".");
totale = eval(prezzo*quantita);
//Arrotondamento
totale = String(Math.round(totale*100));
while (totale.length < 3) totale = '0' + totale;
totale = totale.replace(/([0-9][0-9])$/,".$1");
//Virgola al posto del punto
totale = totale.replace(/\./g , ",");
document.getElementById('totale'+i).value = totale;
//TOTALE GENERALE
totale1 = eval(document.getElementById('totale1').value.replace(/\,/g , ".")*1);
totale2 = eval(document.getElementById('totale2').value.replace(/\,/g , ".")*1);
totale3 = eval(document.getElementById('totale3').value.replace(/\,/g , ".")*1);
totale4 = eval(document.getElementById('totale4').value.replace(/\,/g , ".")*1);
totale5 = eval(document.getElementById('totale5').value.replace(/\,/g , ".")*1);
totale6 = eval(document.getElementById('totale6').value.replace(/\,/g , ".")*1);
totalegen = String(Math.round((totale1+totale2+totale3+totale4+totale5+totale6)*100));
while (totalegen.length < 3) totalegen = '0' + totalegen;
totalegen = totalegen.replace(/([0-9][0-9])$/,".$1");
totalegen = totalegen.replace(/\./g , ",");
document.getElementById('totalegen').value = totalegen;
}
//-->
</script>