a mio parere hai invertito l' assegnazione
Codice PHP:
<script language="javascript">
function somma() {
var subtotale = document.getElementById("imponibile").value;
var iva = document.getElementById("iva").value;
subtotale = (isNaN(parseFloat(subtotale)) ? 0 : parseFloat(subtotale));
iva = (isNaN(parseFloat(iva)) ? 0 : parseFloat(iva));
totale = (subtotale+iva).toFixed(2);
document.getElementById("fattura").value = totale;
}
</script>