Ver Mensaje Individual
  #9 (permalink)  
Antiguo 18/01/2011, 15:47
Montes28
 
Fecha de Ingreso: septiembre-2010
Mensajes: 1.853
Antigüedad: 13 años, 7 meses
Puntos: 6
Respuesta: tengo problemas con el onfocus y el onblur no se ejecutan

<SCRIPT>

function startCalc(){
interval = setInterval("calc()",1);
}
function calc(){
one = document.autoSumForm.firstBox.value;
two = document.autoSumForm.secondBox.value;
document.autoSumForm.thirdBox.value = (one * 1) + (two * 1);
}
function stopCalc(){
clearInterval(interval);
}
</SCRIPT>


y creo dos inputs con php


echo"<input class='right' type='text' name='firstBox' onfocus='startCalc();' onblur='stopCalc();'readonly=''/>";

echo"<input type='text' name='secondBox' value='' onfocus='startCalc();' onblur='stopCalc();' id='secondBox'/>";

echo"<input class='right' type='text' name='thirdBox' readonly=''/>";