Tema: sumatoria
Ver Mensaje Individual
  #2 (permalink)  
Antiguo 23/08/2005, 13:09
Avatar de cmartin81
cmartin81
 
Fecha de Ingreso: enero-2004
Ubicación: Mexico D.F.
Mensajes: 93
Antigüedad: 20 años, 4 meses
Puntos: 0
Tal ves esto te sirva:

Funcion javascript:
Código HTML:
<script language="javascript">
	function sumar()
	{
		valor1=eval(document.luigi.tot1.value);
		valor2=eval(document.luigi.tot2.value);
		suma=valor1 + valor2;
		document.luigi.total.value=suma;
	}
</script> 
Codigo formulario:
Código HTML:
<form name="luigi">
	<input type="text" name="tot1">
	<br>
	<input type="text" name="tot2">
	<br>
	<input type="button" value="Sumar" onclick="sumar()">
	<br>
	<input type="text" name="total">
	<br>
</form> 
__________________
_______________________________
Carlos Martin J.