segue formulário que envia as informações: e esta com um problema quando digito 1000.99 ele repete 100.9 falta um didito. Este código faz para de um sistema de gestão orçamentaria que o contrato pode ser pago de forma linear ou não.
<!-- <script src=moeda.js language="javascript"></script> -->
<form action=script.php method=post>
<table border=0><tr><td>
<input type=hidden name=mes value='01/2012'>01/20XX<input type="text" name=vl1 onkeypress="mudanome();soma();" id="nome" onKeyPress="return(MascaraMoeda(this,'.',',',event))"><br>
02/20XX<input type="text" name=vl2 id="vl2" onkeypress="soma();"/><br>
03/20XX<input type="text" name=vl3 id="vl3" onkeypress="soma();"/><br>
04/20XX<input type="text" name=vl4 id="vl4" onkeypress="soma();"/></td><td>
05/20XX<input type="text" name=vl5 id="vl5" onkeypress="soma();"/><br>
06/20XX<input type="text" name=vl6 id="vl6" onkeypress="soma();"/><br>
07/20XX<input type="text" name=vl7 id="vl7" onkeypress="soma();"/><br>
08/20XX<input type="text" name=vl8 id="vl8" onkeypress="soma();"/></td><td>
09/20XX<input type="text" name=vl9 id="vl9" onkeypress="soma();"/><br>
10/20XX<input type="text" name=vl10 id="vl10" onkeypress="soma();"/><br>
11/20XX<input type="text" name=vl11 id="vl11" onkeypress="soma();"/><br>
12/20XX<input type="text" name=vl12 id="vl12" onkeypress="soma();"/></td></tr><tr>
<td colspan=2>VALOR TOTAL DO CONTRATO</td><td style='text-align:right'><input type="text" id="total" /></tr></tr>
</table>
<input type=submit value=enviar><input type=reset value=limpar>
</form>
<script>
function mudanome()
{
for(i=1; i<=12; i++){
document.getElementById("vl"+i).value = document.getElementById("nome").value;
}
}
function soma(){
var c1 = parseFloat(document.getElementById("vl1").value);
var c2 = parseFloat(document.getElementById("vl2").value);
var c3 = parseFloat(document.getElementById("vl3").value);
var c4 = parseFloat(document.getElementById("vl4").value);
var c5 = parseFloat(document.getElementById("vl5").value);
var c6 = parseFloat(document.getElementById("vl6").value);
var c7 = parseFloat(document.getElementById("vl7").value);
var c8 = parseFloat(document.getElementById("vl8").value);
var c9 = parseFloat(document.getElementById("vl9").value);
var c10 = parseFloat(document.getElementById("vl10").value);
var c11 = parseFloat(document.getElementById("vl11").value);
var c12 = parseFloat(document.getElementById("vl12").value);
if (isNaN(c1)) c1 = 0;
if (isNaN(c2)) c2 = 0;
if (isNaN(c3)) c3 = 0;
if (isNaN(c4)) c4 = 0;
if (isNaN(c5)) c5 = 0;
if (isNaN(c6)) c6 = 0;
if (isNaN(c7)) c7 = 0;
if (isNaN(c8)) c8 = 0;
if (isNaN(c9)) c9 = 0;
if (isNaN(c10)) c10 = 0;
if (isNaN(c11)) c11 = 0;
if (isNaN(c12)) c12 = 0;
var soma = parseFloat(c1+c2+c3+c4+c5+c6+c7+c8+c9+c10+c11+c12);
document.getElementById("total").value = parseFloat(soma.toFixed(2));
}
</script>