Ver Mensaje Individual
  #1 (permalink)  
Antiguo 12/08/2011, 16:17
tumbero_x
 
Fecha de Ingreso: octubre-2010
Ubicación: Buenos Aires
Mensajes: 557
Antigüedad: 13 años, 7 meses
Puntos: 4
Problemas con una funcion

Que tal amigos!!!
tengo una funcion que consegui googleando para aceptar solo numeros en un input
, funciona bien pero el firebug de firefox me dice "event is not defined"
la funcion es esta
Código Javascript:
Ver original
  1. function s(evt)
  2. {
  3. var charCode = (evt.which) ? evt.which : event.keyCode
  4. if (charCode > 31 && (charCode < 48 || charCode > 57))
  5. return false;
  6.  
  7. return true;
  8. }
y lo inicio de asi
onKeyPress="return s(event)"
Saludos y muchas gracias!!!