Ver Mensaje Individual
  #4 (permalink)  
Antiguo 05/01/2010, 14:17
Lytha
 
Fecha de Ingreso: junio-2009
Mensajes: 8
Antigüedad: 14 años, 11 meses
Puntos: 0
De acuerdo Respuesta: Las teclas tab no funcionan

eso es correcto el codigo queda:
function validar_numero(e) { //
tecla = (document.all) ? e.keyCode : e.which; //
if ((tecla==8) || (tecla==0)) return true; //
patron =/\d/ //
te = String.fromCharCode(tecla); //
return patron.test(te); //
} //Para número


function validar_texto(e) { //
tecla = (document.all) ? e.keyCode : e.which; //
if ((tecla==8) || (tecla==0)) return true; //
patron =/[A-Za-z\s]/; //
te = String.fromCharCode(tecla); //
return patron.test(te); //
} // Para Texto