Ver Mensaje Individual
  #4 (permalink)  
Antiguo 27/12/2006, 02:37
Avatar de JavierB
JavierB
Colaborador
 
Fecha de Ingreso: febrero-2002
Ubicación: Madrid
Mensajes: 25.052
Antigüedad: 22 años, 1 mes
Puntos: 772
Re: calculo de nota final al introducir notas parciales

Hola de nuevo.

Te he preparado un código, a ver si te sirve:
Código PHP:
<html>
<
head>
<
script type="text/javascript">
function 
calcular(frm) {
  
n1 parseFloat(frm.nota1.value);
  
n2 parseFloat(frm.nota2.value);
  
n3 parseFloat(frm.nota3.value);
  if(
isNaN(n1)) n1=0;
  if(
isNaN(n2)) n2=0;
  if(
isNaN(n3)) n3=0;
  
frm.total.value n1*.4 n2*.3 n3*.3;
}
</script>
</head>
<body>
<form>
<input type="text" name="nota1" onkeyup="calcular(this.form)" />
<input type="text" name="nota2" onkeyup="calcular(this.form)" />
<input type="text" name="nota3" onkeyup="calcular(this.form)" />
<input type="text" name="total" readonly="readonly" /> 
</form>
</body>
</html> 
Saludos,