Ver Mensaje Individual
  #2 (permalink)  
Antiguo 01/08/2002, 08:59
Avatar de Cain
Cain
 
Fecha de Ingreso: enero-2002
Ubicación: Catalunya
Mensajes: 6.459
Antigüedad: 23 años, 2 meses
Puntos: 17
Re: Las operaciones en JavaScript

Código:
<form action="prueba" method="get" name="prueba">
tc <input name="tc" type="text" value="1" size="10" maxlength="10" onChange="Javascript:document.prueba.mult.value = document.prueba.tc.value * document.prueba.v_1.value";><br>
valor_1 <input name="v_1" type="text" size="10" maxlength="10" onChange="Javascript:document.prueba.mult.value = document.prueba.tc.value * document.prueba.v_1.value";><br>
mult <input name="mult" type="text" size="10" maxlength="10" onChange="Javascript:document.prueba.total.value = document.prueba.mul.value + document.prueba.suma.value - document.prueba.resta.value"><br>
valor_suma <input name="suma" type="text" size="10" maxlength="10" onChange="Javascript:document.prueba.total.value = document.prueba.mul.value + document.prueba.suma.value - document.prueba.resta.value"><br>
valor_resta <input name="resta" type="text" size="10" maxlength="10" onChange="Javascript:document.prueba.total.value = document.prueba.mul.value + document.prueba.suma.value - document.prueba.resta.value"><br>
total <input name="total" type="text" size="10" maxlength="10" onBlur="computar(this.form)"></form>
Ahí está más o menos, podría mejorarse si en lugar de poner los codigos en OnChange, los crearamos una función y en OnChange llamarams a la función.

Joe Tawers,
<a href="http://www.ilimit.com/towers">http://www.ilimit.com/towers</a>