Ver Mensaje Individual
  #7 (permalink)  
Antiguo 24/10/2007, 08:29
Avatar de Nachzeher
Nachzeher
 
Fecha de Ingreso: enero-2003
Mensajes: 249
Antigüedad: 22 años
Puntos: 1
Re: Validar "Tab" y "BackSpace" en inputbox (firefox)

Por el momento, solo me funciona el "Backspace" el Tabulador.. no anda por nada.. . (NOTA: SOLO EN FIREFOX FALLA)

Todo bien con Opera y "esploler"..


Código PHP:
function CheckNumericCharacter(event)
{
  if (
String.fromCharCode(event.which) >= "0" && 
      
String.fromCharCode(event.which) <= "9" ) {
    return 
true; }
  else if (
String.fromCharCode(event.which) == "." || 
      
String.fromCharCode(event.which) == "," )  {
    return 
true; }
  else if ( 
event.which == || event.which == )
     return 
true;
  else {
    return 
false;
  }


la mando llamar así (Incluído el consejo de JavierB, de usar onKeyup):

Código PHP:
onKeypress="return CheckNumericCharacter(event)" onKeyup="return CheckNumericCharacter(event)" 

No me deja usar el tabulador para pasar a otro inputbox