Ver Mensaje Individual
  #2 (permalink)  
Antiguo 26/03/2013, 21:07
Avatar de emprear
emprear
Colaborador
 
Fecha de Ingreso: junio-2007
Ubicación: me mudé
Mensajes: 8.388
Antigüedad: 17 años, 2 meses
Puntos: 1567
Respuesta: validacion formulario campo telefono

Podés forzar esas condiciones sin tener que validar nada

Código HTML:
Ver original
  1. <!DOCTYPE html>
  2. <html lang="es-ar">
  3. <meta charset="utf-8" />
  4. <title>solo 9 números</title>
  5. var nav4 = window.Event ? true : false;
  6. function aceptNum(evt){
  7. var key = nav4 ? evt.which : evt.keyCode;
  8. return (key <= 13 || (key>= 48 && key <= 57));
  9. }
  10. </head>
  11. <form action="#">
  12. <input type="text" name="valor" size="9" maxlength="9" onkeypress="return aceptNum(event)" onpaste="return false;">
  13. </form>
  14. </body>
  15. </html>

Saludos
__________________
La voz de las antenas va, sustituyendo a Dios.
Cuando finalice la mutación, nueva edad media habrá
S.R.

Última edición por emprear; 26/03/2013 a las 22:57