Ver Mensaje Individual
  #1 (permalink)  
Antiguo 03/08/2010, 18:08
humbertoqa
 
Fecha de Ingreso: septiembre-2006
Mensajes: 2
Antigüedad: 17 años, 7 meses
Puntos: 0
Como colocar Puntos Decimales en Formulario

Buenas noches,

Realice un pequeño formulario con una operación para calcular el costo de una prima de seguros. Funciona correctamente, pero ahora quiero que cuando se llene el formulario, automaticamente se llenen con puntos los epacios de dedecimales. Ej:
1000000 = 1.000.000

Muchas gracias a todos!

Aquí está el código:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" type="text/css" href="style.css" />
<title>Calculadora Seguro</title>
<script>
function calcular() {
ne=eval(document.getElementById('neto').value);
iv=eval(document.getElementById('iva').value);
tiv = ne + iv; /*Casilla Total IVA*/
tot = tiv / 2; /*Casilla Total */
document.getElementById('totiva').value=tiv;
document.getElementById('total').value=tot;
}


</script>
</head>

<body>
<li> Valor Canon Arriendo <input type="text" id="neto" value="" onkeyup="calcular()" onKeyPress="EvaluateText('%f', this);" onBlur="this.value = NumberFormat(this.value, '1', '.', ',')" /> </li><br />
<li> Valor Administracion <input type="text" id="iva" value="" onkeyup="calcular()" onKeyPress="EvaluateText('%f', this);" onBlur="this.value = NumberFormat(this.value, '1', '.', ',')" /> </li><br />
<li> Total....... <input type="text" id="totiva" disabled="disabled" /> </li><br />
<li> Valor Poliza...... <input type="text" id="total" disabled="disabled" /> </li><br />
</body>
</html>