![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
01/08/2002, 14:17
|
| | Fecha de Ingreso: marzo-2002
Mensajes: 99
Antigüedad: 22 años, 10 meses Puntos: 0 | |
Re: Las operaciones en JavaScript <script language="JavaScript">
<!--
function llenar(){
document.forms[0].total.value = document.forms[0].mult.value + document.forms[0].suma.value - document.forms[0].resta.value;
}
//-->
</script>
</head>
<body>
<form action="prueba" method="get" name="prueba">
tc <input name="tc" type="text" value="1" size="10" maxlength="10" onChange="Javascript:document.prueba.mult.val ue = 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.val ue = document.prueba.tc.value * document.prueba.v_1.value";><br>
mult <input name="mult" type="text" size="10" maxlength="10" onChange="Javascript:document.prueba.mult.val ue = document.prueba.tc.value * document.prueba.v_1.value"; onBlur="llenar();"><br>
valor_suma <input name="suma" type="text" size="10" maxlength="10" onChange="llenar();"><br>
valor_resta <input name="resta" type="text" size="10" maxlength="10" onChange="llenar();"><br>
total <input name="total" type="text" size="10" maxlength="10" >
</form>
puedes revisar esta funcion, tengo un problema, esta adjuntando los codigos... es decir, al campo total, se adjuntan los campos suma y resta, no los suma o resta, que hago. |